Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batcher ¶
func NewBatcher ¶
func (*Batcher[IN, OUT]) EnterAndWait ¶ added in v0.11.25
type Entry ¶
type Entry[IN, OUT any] interface { Value() IN Callback(out OUT) // contains filtered or unexported methods }
type MultiBatcher ¶
type MultiBatcher[IN, OUT any] struct { // contains filtered or unexported fields }
func NewMulti ¶
func NewMulti[IN, OUT any](f Func[IN, OUT], opt ...Option) *MultiBatcher[IN, OUT]
NewMulti creates a pool of Batcher functions. By calling Enter or EnterAndWait you add the item into the Batcher which is identified by 'tagID'.
func (*MultiBatcher[IN, OUT]) Enter ¶
func (fp *MultiBatcher[IN, OUT]) Enter(targetID string, entry Entry[IN, OUT])
func (*MultiBatcher[IN, OUT]) EnterAndWait ¶
func (fp *MultiBatcher[IN, OUT]) EnterAndWait(targetID string, entry Entry[IN, OUT])
type Option ¶
type Option func(*config)
func WithBatchSize ¶
WithBatchSize sets the maximum number of entries to batch together. Defaults to 100.
func WithMaxWorkers ¶
WithMaxWorkers sets the maximum number of workers to use. Defaults to runtime.NumCPU() * 10.
func WithMinWaitTime ¶
WithMinWaitTime sets the minimum amount of time to wait before flushing a batch. Defaults to 0.
Click to show internal directories.
Click to hide internal directories.