pubsub
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
Constants¶
const BufferSize = 2048
BufferSize is the maximum number of unhandled messages we will bufferfor a subscriber before dropping messages.
Variables¶
var ErrDroppedMessages =xerrors.New("dropped messages")
ErrDroppedMessages is sent to ListenerWithErr if messages are dropped ormight have been dropped.
Functions¶
This section is empty.
Types¶
typeListenerWithErr¶
ListenerWithErr represents a pubsub handler that can also receive errorindications
typeMemoryPubsub¶added inv0.26.1
type MemoryPubsub struct {// contains filtered or unexported fields}
MemoryPubsub is an in-memory Pubsub implementation. It's an exported type so that our test code can do typechecks.
func (*MemoryPubsub)Close¶added inv0.26.1
func (*MemoryPubsub) Close()error
func (*MemoryPubsub)Publish¶added inv0.26.1
func (m *MemoryPubsub) Publish(eventstring, message []byte)error
func (*MemoryPubsub)Subscribe¶added inv0.26.1
func (m *MemoryPubsub) Subscribe(eventstring, listenerListener) (cancel func(), errerror)
func (*MemoryPubsub)SubscribeWithErr¶added inv0.26.1
func (m *MemoryPubsub) SubscribeWithErr(eventstring, listenerListenerWithErr) (cancel func(), errerror)
typePubsub¶
type Pubsub interface {Subscribe(eventstring, listenerListener) (cancel func(), errerror)SubscribeWithErr(eventstring, listenerListenerWithErr) (cancel func(), errerror)Publish(eventstring, message []byte)errorClose()error}
Pubsub is a generic interface for broadcasting and receiving messages.Implementors should assume high-availability with the backing implementation.
funcNewInMemory¶
func NewInMemory()Pubsub