pubsub

package module
v0.0.0-...-d33996c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsubscribed = errors.New("unsubscribed")

Functions

This section is empty.

Types

type PubSub

type PubSub interface {
	Subscribe(_ context.Context, topic string) (Subscriber, error)
	Publish(_ context.Context, topic string, payload []byte) error
}

type Subscriber

type Subscriber interface {
	Unsubscribe(context.Context) error

	// Returns ErrUnsubscribed if unsubscribed.
	Consume(context.Context) ([]byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL