pubsub

package
v0.5.9-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 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 Subscriber

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

Subscriber deals with the subscribing part of our PubSub

type Subscription

type Subscription 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