flushhandler

package
v1.0.0-beta.139 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DrainCompleteFunc

type DrainCompleteFunc func()

type FlushCallback

type FlushCallback func(context.Context, []models.SinkMessage) error

type FlushEventHandler

type FlushEventHandler interface {
	OnFlushSuccess(ctx context.Context, events []models.SinkMessage) error
	Start(context.Context) error
	WaitForDrain(context.Context) error
}

func NewFlushEventHandler

func NewFlushEventHandler(opts FlushEventHandlerOptions) (FlushEventHandler, error)

type FlushEventHandlerOptions

type FlushEventHandlerOptions struct {
	Name     string
	Callback FlushCallback

	Logger      *slog.Logger
	MetricMeter metric.Meter

	DrainTimeout    time.Duration
	CallbackTimeout time.Duration
}

type FlushEventHandlers

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

func NewFlushEventHandlers

func NewFlushEventHandlers() *FlushEventHandlers

func (*FlushEventHandlers) AddHandler

func (f *FlushEventHandlers) AddHandler(handler FlushEventHandler)

func (*FlushEventHandlers) OnDrainComplete

func (f *FlushEventHandlers) OnDrainComplete(fn DrainCompleteFunc)

func (*FlushEventHandlers) OnFlushSuccess

func (f *FlushEventHandlers) OnFlushSuccess(ctx context.Context, events []models.SinkMessage) error

func (*FlushEventHandlers) Start

func (f *FlushEventHandlers) Start(ctx context.Context) error

func (*FlushEventHandlers) WaitForDrain

func (f *FlushEventHandlers) WaitForDrain(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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