mirror of
https://github.com/mochi-mqtt/server.git
synced 2025-10-30 03:01:58 +08:00
optimise Server struct
This commit is contained in:
@@ -45,16 +45,16 @@ var (
|
|||||||
// Server is an MQTT broker server. It should be created with server.New()
|
// Server is an MQTT broker server. It should be created with server.New()
|
||||||
// in order to ensure all the internal fields are correctly populated.
|
// in order to ensure all the internal fields are correctly populated.
|
||||||
type Server struct {
|
type Server struct {
|
||||||
|
inline inlineMessages // channels for direct publishing.
|
||||||
|
Events events.Events // overrideable event hooks.
|
||||||
|
Store persistence.Store // a persistent storage backend if desired.
|
||||||
Listeners *listeners.Listeners // listeners are network interfaces which listen for new connections.
|
Listeners *listeners.Listeners // listeners are network interfaces which listen for new connections.
|
||||||
Clients *clients.Clients // clients which are known to the broker.
|
Clients *clients.Clients // clients which are known to the broker.
|
||||||
Topics *topics.Index // an index of topic filter subscriptions and retained messages.
|
Topics *topics.Index // an index of topic filter subscriptions and retained messages.
|
||||||
System *system.Info // values about the server commonly found in $SYS topics.
|
System *system.Info // values about the server commonly found in $SYS topics.
|
||||||
Store persistence.Store // a persistent storage backend if desired.
|
bytepool *circ.BytesPool // a byte pool for incoming and outgoing packets.
|
||||||
done chan bool // indicate that the server is ending.
|
|
||||||
bytepool circ.BytesPool // a byte pool for incoming and outgoing packets.
|
|
||||||
sysTicker *time.Ticker // the interval ticker for sending updating $SYS topics.
|
sysTicker *time.Ticker // the interval ticker for sending updating $SYS topics.
|
||||||
inline inlineMessages // channels for direct publishing.
|
done chan bool // indicate that the server is ending.
|
||||||
Events events.Events // overrideable event hooks.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// inlineMessages contains channels for handling inline (direct) publishing.
|
// inlineMessages contains channels for handling inline (direct) publishing.
|
||||||
|
|||||||
Reference in New Issue
Block a user