pubsub

package
v2.2.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotRunning = errors.New("not running")

ErrNotRunning is the error with message "not running"

Functions

func AfterThreadStart

func AfterThreadStart(t *testing.T) <-chan time.Time

AfterThreadStart waits for the duration of delay thread start

func SleepForThreadStart

func SleepForThreadStart(t *testing.T)

SleepForThreadStart pass go routine for the duration of delay thread start

Types

type Bus

type Bus interface {
	Publisher
	Subscribe() (Subscriber, error)
	Close()
	Done() <-chan struct{}
}

Bus is an async event bus that allows subscriptions to behave as a bus themselves. When an event is published, it is sent to all subscribers asynchronously - a subscriber cannot block other subscribers.

NOTE: this should probably be in util/event or something (not in provider/event)

func NewBus

func NewBus() Bus

NewBus runs a new bus and returns bus details

type Event

type Event interface{}

Event interface

type Publisher

type Publisher interface {
	Publish(Event) error
}

type Subscriber

type Subscriber interface {
	Events() <-chan Event
	Clone() (Subscriber, error)
	Close()
	Done() <-chan struct{}
}

Subscriber emits events it sees on the channel returned by Events(). A Clone() of a subscriber will emit all events that have not been emitted from the cloned subscriber. This is important so that events are not missed when adding subscribers for sub-components (see `provider/bidengine/{service,order}.go`)

Jump to

Keyboard shortcuts

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