pubsub

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Publisher

type Publisher interface {
	Notify(e SubjectEvent)
}

Publisher introduces "write" capabilities on the subject

type Subject

type Subject interface {
	Subscriber
	Publisher
}

Subject represent the interface for a subject

func NewSubject

func NewSubject(logger *zap.Logger) Subject

NewSubject creates a new instance of the internal struct

type SubjectChannel

type SubjectChannel chan SubjectEvent

SubjectChannel is the channel that will pass the events

type SubjectEvent

type SubjectEvent interface{}

SubjectEvent is the event being fired

type Subscriber

type Subscriber interface {
	Register(id string) (SubjectChannel, error)
	Deregister(id string)
}

Subscriber represents the base functionality of a subject (used by observers)

Jump to

Keyboard shortcuts

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