Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PubSub ¶
type PubSub interface { // Publish publishes the object to the channel by name Publish(channel string, obj interface{}) error // Publish publishes the object to the channel by name to the first N subscribers of the channel PublishN(channel string, obj interface{}, n int) error // Subscribe subscribes to the given channel until the context is cancelled Subscribe(ctx context.Context, channel string, handler func(obj interface{})) error // Subscribe subscribes to the given channel until it receives N messages or the context is cancelled SubscribeN(ctx context.Context, channel string, n int, handler func(msg interface{})) error Close() }
PubSub is used to asynchronously pass messages between routines.
Click to show internal directories.
Click to hide internal directories.