pubsub

package
v0.0.0-...-c57eb44 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Action string    `json:"action"`
	Id     uuid.UUID `json:"id"`
}

type PubSub

type PubSub struct {
	// contains filtered or unexported fields
}

func NewPubSub

func NewPubSub() *PubSub

func (*PubSub) Publish

func (p *PubSub) Publish(evt Event)

Publish an event

func (*PubSub) Subscribe

func (p *PubSub) Subscribe(ctx context.Context) chan Event

Subscribe

func (*PubSub) Wait

func (p *PubSub) Wait()

Wait for all subscribers closing

Jump to

Keyboard shortcuts

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