buffer

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

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

func NewBuffer

func NewBuffer[T any](bufferSize int, consumer BufferedConsumer[T]) *Buffer[T]

NewBuffer creates a buffer with a given size.

func (*Buffer[T]) Append

func (b *Buffer[T]) Append(ctx context.Context, item T) error

func (*Buffer[T]) Flush

func (b *Buffer[T]) Flush(ctx context.Context) error

type BufferedConsumer

type BufferedConsumer[T any] func(ctx context.Context, buffer []T) error

Jump to

Keyboard shortcuts

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