Documentation
¶
Index ¶
Constants ¶
View Source
const ( NotifyPath = "/kylin/cluster/notify" ListPath = "/kylin/cluster/list" ConnectPath = "/kylin/cluster/connect" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageHandler ¶
type MessageHandler func(message interface{}) (handled bool)
type Node ¶
type Node interface {
Info() NodeInfo
Start() error
Stop() error
WaitForDone()
AddNodeJoinListener(NodeJoinListener)
AddNodeDropListener(NodeDropListener)
List() []NodeInfo
RegisterMessage(message interface{})
Broadcast(message interface{})
SendTo(address string, message interface{})
}
type NodeConnection ¶
type NodeDropListener ¶
type NodeDropListener func(NodeConnection)
type NodeJoinListener ¶
type NodeJoinListener func(NodeConnection)
type OnPubSubMessage ¶
type OnPubSubMessage func(topic string, message interface{})
type PubSub ¶
type PubSub interface {
Publish(topic string, message interface{})
Subscribe(topic string)
Unsubscribe(topic string)
GetSubscribersAsync(topic string, resultChan chan []string)
GetSubscribers(topic string) []string
Start() error
Stop() error
WaitForDone()
}
func NewPubSub ¶
func NewPubSub(node Node, onMessage OnPubSubMessage) PubSub
Click to show internal directories.
Click to hide internal directories.