Documentation ¶
Index ¶
Constants ¶
View Source
const BufferSize = 2048
BufferSize is the maximum number of unhandled messages we will buffer for a subscriber before dropping messages.
Variables ¶
View Source
var ErrDroppedMessages = xerrors.New("dropped messages")
ErrDroppedMessages is sent to ListenerWithErr if messages are dropped or might have been dropped.
Functions ¶
This section is empty.
Types ¶
type ListenerWithErr ¶
ListenerWithErr represents a pubsub handler that can also receive error indications
type Pubsub ¶
type Pubsub interface { Subscribe(event string, listener Listener) (cancel func(), err error) SubscribeWithErr(event string, listener ListenerWithErr) (cancel func(), err error) Publish(event string, message []byte) error Close() error }
Pubsub is a generic interface for broadcasting and receiving messages. Implementors should assume high-availability with the backing implementation.
func NewInMemory ¶
func NewInMemory() Pubsub
Click to show internal directories.
Click to hide internal directories.