pubsub

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrSubscriptionCanceled = errors.Error("subscription canceled")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter func(interface{}) bool

type PubSub

type PubSub interface {
	Publisher
	Subscriber
}

func New

func New() PubSub

New constructs and returns a new PubSub

type Publisher

type Publisher interface {
	Publish(interface{})
}

Publisher deals with the publishing part of our PubSub

type QueueSubscription added in v0.8.0

type QueueSubscription struct {
	Queue *queue.Queue
	// contains filtered or unexported fields
}

func (*QueueSubscription) Cancel added in v0.8.0

func (ps *QueueSubscription) Cancel()

func (*QueueSubscription) Channel added in v0.15.0

func (ps *QueueSubscription) Channel() <-chan interface{}

func (*QueueSubscription) Next added in v0.8.0

func (ps *QueueSubscription) Next() (interface{}, error)

type Subscriber

type Subscriber interface {
	Subscribe(...Filter) Subscription
}

Subscriber deals with the subscribing part of our PubSub

type Subscription

type Subscription interface {
	Channel() <-chan interface{}
	Next() (interface{}, error)
	Cancel()
}

Subscription is returned for every subscription

Jump to

Keyboard shortcuts

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