flusher

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFull     = serviceerror.NewUnavailable("flush buffer is full")
	ErrShutdown = serviceerror.NewUnavailable("flush buffer is shutdown")
)

Functions

func NewFlusher

func NewFlusher[T any](
	bufferCapacity int,
	numBuffer int,
	flushTimeout time.Duration,
	writer Writer[T],
	logger log.Logger,
) *flusherImpl[T]

Types

type FlushItem

type FlushItem[T any] struct {
	Item   T
	Future *future.FutureImpl[struct{}]
}

type Flusher

type Flusher[T any] interface {
	common.Daemon
	Buffer(item T) future.Future[struct{}]
}

type Writer

type Writer[T any] interface {
	Write(items []T) error
}

Jump to

Keyboard shortcuts

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