batchqueue

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchQueue

type BatchQueue[T any] struct {
	Name         string
	MaxBatchSize int
	FlushTimeout time.Duration
	// contains filtered or unexported fields
}

func New

func New[T any](name string, size int, batchSize int, flushTimeout time.Duration) *BatchQueue[T]

func (*BatchQueue[T]) Add

func (q *BatchQueue[T]) Add(ctx context.Context, item T)

func (*BatchQueue[T]) Close

func (q *BatchQueue[T]) Close()

func (*BatchQueue[T]) Consume

func (q *BatchQueue[T]) Consume(handler Handler[T])

type Handler

type Handler[T any] func(context.Context, []T)

type Item

type Item[T any] struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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