Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PubWithContext ¶
PubWithContext returns a copy of parent in which the `Pub` is stored
func SubWithContext ¶
SubWithContext returns a copy of parent in which the `Sub` is stored
Types ¶
type MsgHandler ¶
type Pub ¶
type Pub interface { // Publish publishes data to the channel ch Publish(ctx context.Context, ch string, data []byte) error }
Pub is the publish interface
func PubFromContext ¶
PubFromContext returns a `Pub` instance associated with `ctx`, or the local `Pub` if no instance could be found.
type PubSub ¶
type PubSub interface { Pub Sub // Start does the initialisation work to bootstrap a PubSub adapter. // For example, this function may open a connection, start an event loop, etc. Start(ctx context.Context) error // Drain signals to the pubsub client/server that inbound messages should // no longer be accepted, but outbound messages can still be delivered. Drain() // Close closes the client/server for both inbound/outbound messages Close() error }
func FromContext ¶
FromContext returns a `PubSub` instance associated with `ctx`, or the local `Sub` if no instance could be found.
type Sub ¶
type Sub interface { // Subscribe subscribes the message handler h to the channel ch. // All subscriptions with the same q will form a queue group. // Each message will be delivered to only one subscriber per queue group. Subscribe(q, ch string, h MsgHandler) error }
Sub is the subscribe interface
func SubFromContext ¶
SubFromContext returns a `Sub` instance associated with `ctx`, or the local `Sub` if no instance could be found.
Click to show internal directories.
Click to hide internal directories.