worker

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FanOut

type FanOut[I, O any] struct {
	// contains filtered or unexported fields
}

func NewFanOut

func NewFanOut[I, O any](workerCount, bufferSize int) *FanOut[I, O]

func (*FanOut[I, O]) Close

func (f *FanOut[I, O]) Close()

func (*FanOut[I, O]) Invoke

func (f *FanOut[I, O]) Invoke(input I)

func (*FanOut[I, O]) Process

func (f *FanOut[I, O]) Process(p ProcessorFunc[I])

type HashFunc

type HashFunc[I any] func(I) int

type HashedFanOut

type HashedFanOut[I, O any] struct {
	FanOut[I, O]
	// 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, O any](workerCount, bufferSize int, hasher HashFunc[I]) *HashedFanOut[I, O]

func (*HashedFanOut[I, O]) Close

func (f *HashedFanOut[I, O]) Close()

func (*HashedFanOut[I, O]) Invoke

func (f *HashedFanOut[I, O]) Invoke(input I)

func (*HashedFanOut[I, O]) Process

func (f *HashedFanOut[I, O]) Process(p ProcessorFunc[I])

type ProcessorFunc

type ProcessorFunc[I any] func(I)

Jump to

Keyboard shortcuts

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