utils

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WorkQueue

type WorkQueue[T WorkQueueItem] struct {
	// contains filtered or unexported fields
}

func NewWorkQueue

func NewWorkQueue[T WorkQueueItem](bufferSize int, concurrency int,
	handler WorkQueueFn[T]) *WorkQueue[T]

func (*WorkQueue[T]) Add

func (q *WorkQueue[T]) Add(item T) bool

func (*WorkQueue[T]) Start

func (q *WorkQueue[T]) Start()

func (*WorkQueue[T]) Stop

func (q *WorkQueue[T]) Stop()

func (*WorkQueue[T]) Wait

func (q *WorkQueue[T]) Wait()

func (*WorkQueue[T]) WithCallbacks

func (q *WorkQueue[T]) WithCallbacks(callbacks WorkQueueCallbacks[T])

type WorkQueueCallbackOnItemFn

type WorkQueueCallbackOnItemFn[T WorkQueueItem] func(q *WorkQueue[T], item T)

type WorkQueueCallbacks

type WorkQueueCallbacks[T WorkQueueItem] struct {
	OnAdd  WorkQueueCallbackOnItemFn[T]
	OnDone WorkQueueCallbackOnItemFn[T]
}

type WorkQueueFn

type WorkQueueFn[T WorkQueueItem] func(q *WorkQueue[T], item T) error

type WorkQueueItem

type WorkQueueItem interface {
	Id() string
}

Jump to

Keyboard shortcuts

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