batchsender

package
v4.72.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchSender

type BatchSender struct {
	// contains filtered or unexported fields
}

BatchSender is a helper struct that batches items and sends them in batches of batchSize or after batchTimeout.

- If item is already a slice, it will be sent directly - Otherwise, it will be added to the current batch - If the current batch has reached the batch size, it will be sent immediately - Otherwise, a timer will be started to send the current batch after the batch timeout

func NewBatchSender

func NewBatchSender(sendFn func(any)) *BatchSender

func (*BatchSender) Close

func (bs *BatchSender) Close()

func (*BatchSender) Send

func (bs *BatchSender) Send(item any)

Jump to

Keyboard shortcuts

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