sm

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Created int32 = iota
	Running
	ReceiverStopped
	PrepareStop
	Stopped
)

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 Loop added in v0.6.0

type Loop struct {
	Itemcount int
	Itemtimes int
	// contains filtered or unexported fields
}

func NewLoop added in v0.6.0

func NewLoop(queue, nextQueue chan any, fn func([]any, chan any), maxBatchSize int) *Loop

func (*Loop) Start added in v0.6.0

func (l *Loop) Start()

func (*Loop) Stop added in v0.6.0

func (l *Loop) Stop()

type OnFinCB

type OnFinCB = func()

type OnItemsCB

type OnItemsCB = func(...any)

type Queue

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

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