Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶ added in v1.3.0
type Filter func(msg interface{}) bool
Filter is a function to filter out messages before they reach a subscriptions primary Handler
type Handler ¶ added in v1.3.0
type Handler func(msg interface{}) bool
Handler is the function executed against the inbound message in a subscription
type PubSub ¶
type PubSub interface { // Publish publishes the object to the channel by name Publish(channel string, obj interface{}) error // Subscribe subscribes to the given channel until the context is cancelled. // If a qgroup is provided, the subscriber will be added to a queue group in which only one subscriber in the group will receive a message per message received Subscribe(ctx context.Context, channel, qgroup string, handler Handler) error // SubscribeFilter subscribes to messages that pass a given filter // If a qgroup is provided, the subscriber will be added to a queue group in which only one subscriber in the group will receive a message per message received SubscribeFilter(ctx context.Context, channel, qgroup string, filter Filter, handler Handler) error // Close closes all subscriptions Close() }
PubSub is used to asynchronously pass messages between routines.
Click to show internal directories.
Click to hide internal directories.