package
1.0.0
Repository: https://github.com/didi/gatekeeper.git
Documentation: pkg.go.dev

# README

Copied from https://github.com/cloudfoundry/go-diodes to avoid test dependencies.

# Functions

NewManyToOne creates a new diode (ring buffer).
NewOneToOne creates a new diode is meant to be used by a single reader and a single writer.
NewPoller returns a new Poller that wraps the given diode.
NewWaiter returns a new Waiter that wraps the given diode.
WithPollingContext sets the context to cancel any retrieval (Next()).
WithPollingInterval sets the interval at which the diode is queried for new data.
WithWaiterContext sets the context to cancel any retrieval (Next()).

# Structs

ManyToOne diode is optimal for many writers (go-routines B-n) and a single reader (go-routine A).
OneToOne diode is meant to be used by a single reader and a single writer.
Poller will poll a diode until a value is available.
Waiter will use a conditional mutex to alert the reader to when data is available.

# Interfaces

Alerter is used to report how many values were overwritten since the last write.
Diode is any implementation of a diode.

# Type aliases

AlertFunc type is an adapter to allow the use of ordinary functions as Alert handlers.
GenericDataType is the data type the diodes operate on.
PollerConfigOption can be used to setup the poller.
WaiterConfigOption can be used to setup the waiter.