sm

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSafeQueue

func NewSafeQueue(queueSize, batchSize int, onItem OnItemsCB) *safeQueue

func NewStateMachine

func NewStateMachine(wg *sync.WaitGroup, closed common.Closable, rQueue, ckpQueue Queue) *stateMachine

Types

type EnqueueOp

type EnqueueOp = func(any) any

type OnFinCB

type OnFinCB = func()

type OnItemsCB

type OnItemsCB = func(...any)

type Queue

type Queue interface {
	Start()
	Stop()
	Enqueue(any) (any, error)
}

type State

type State = int32
const (
	Created State = iota
	Running
	ReceiverStopped
	PrepareStop
	Stopped
)

type StateMachine

type StateMachine interface {
	Start()
	Stop()
	EnqueueRecevied(any) (any, error)
	EnqueueCheckpoint(any) (any, error)
}

Jump to

Keyboard shortcuts

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