Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
PubSub contains channel and subscribers.
func (*PubSub) Close ¶
Close closes PubSub. To inspect unbsubscribing for another subscruber, you must create message structure to notify them. After publish notifycations, Close should be called.
func (*PubSub) Subscribe ¶
func (ps *PubSub) Subscribe(s Subscriber) error
Subscribe subscribe to the PubSub.
func (*PubSub) UnSubscribe ¶
func (ps *PubSub) UnSubscribe(s Subscriber)
UnSubscribe un subscribe to the PubSub.
type Subscriber ¶
type Subscriber interface { // should be unique to used as a map key SubscriberName() string // receive message from publisher OnMessage(v interface{}) }
Subscriber is interface that who want to consume message
Click to show internal directories.
Click to hide internal directories.