Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FanOut ¶
type FanOut[I any] struct { // contains filtered or unexported fields }
FanOut will fan out to `workerCount` total coroutines for processing.
func (*FanOut[I]) Close ¶
func (f *FanOut[I]) Close()
Close closes the input channels. Invoke can not be called again after this call.
func (*FanOut[I]) Invoke ¶
func (f *FanOut[I]) Invoke(input I)
Invoke adds the data to the worker for processing.
func (*FanOut[I]) Process ¶
func (f *FanOut[I]) Process(p ProcessorFunc[I])
Process handles all inputs until the input channel is closed.
type HashFunc ¶
HashFunc converts an input to a uint value. It must be deterministic. See examples below.
type HashedFanOut ¶
type HashedFanOut[I any] struct { // contains filtered or unexported fields }
HashedFanOut is a special purpose fan out that hashes the input so that the same keys are always processed by the same worker. This is used to ensure guard against race conditions in non-reentrant processors.
func NewHashedFanOut ¶
func NewHashedFanOut[I any](workerCount, bufferSize uint, hasher HashFunc[I]) *HashedFanOut[I]
func (*HashedFanOut[I]) Close ¶
func (f *HashedFanOut[I]) Close()
func (*HashedFanOut[I]) Invoke ¶
func (f *HashedFanOut[I]) Invoke(input I)
func (*HashedFanOut[I]) Process ¶
func (f *HashedFanOut[I]) Process(p ProcessorFunc[I])
type ProcessorFunc ¶
type ProcessorFunc[I any] func(I)
Click to show internal directories.
Click to hide internal directories.