internal

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetachContext

func DetachContext(ctx context.Context) context.Context

DetachContext returns a context that keeps all the values of its parent context but detaches from the cancellation and error handling.

Types

type BatchFn added in v0.7.2

type BatchFn[T any] func([]T) error

type BatchResult added in v0.7.2

type BatchResult struct {
	At   time.Time
	Size int
	Err  error
}

type Batcher added in v0.7.2

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

func NewBatcher added in v0.7.2

func NewBatcher[T any](sizeThreshold int, delayThreshold time.Duration, fn BatchFn[T]) *Batcher[T]

func (*Batcher[T]) Enqueue added in v0.7.2

func (b *Batcher[T]) Enqueue(item T) EnqueueStatus

func (*Batcher[T]) Flush added in v0.7.2

func (b *Batcher[T]) Flush() bool

func (*Batcher[T]) Results added in v0.7.2

func (b *Batcher[T]) Results() <-chan BatchResult

type ConnectorState added in v0.8.0

type ConnectorState int
const (
	StateInitial ConnectorState = iota
	StateConfiguring
	StateConfigured
	StateStarting
	StateStarted
	StateInitiatingRun
	StateRunning
	StateInitiatingStop
	StateStopping
	StateStopped
	StateTearingDown
	StateTornDown

	StateErrored ConnectorState = 500
)

func (ConnectorState) String added in v0.8.0

func (i ConnectorState) String() string

type ConnectorStateWatcher added in v0.8.0

type ConnectorStateWatcher csync.ValueWatcher[ConnectorState]

func (*ConnectorStateWatcher) DoWithLock added in v0.8.0

func (w *ConnectorStateWatcher) DoWithLock(
	ctx context.Context,
	opts DoWithLockOptions,
	f func(currentState ConnectorState) error,
) error

func (*ConnectorStateWatcher) Set added in v0.8.0

func (w *ConnectorStateWatcher) Set(newState ConnectorState) bool

type DoWithLockOptions added in v0.8.0

type DoWithLockOptions struct {
	ExpectedStates       []ConnectorState
	StateBefore          ConnectorState
	StateAfter           ConnectorState
	WaitForExpectedState bool
}

type EnqueueStatus added in v0.7.2

type EnqueueStatus int
const (
	Scheduled EnqueueStatus = iota + 1
	Flushed
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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