queue

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotEnoughWorkers = fmt.Errorf("queue requires >= 1 workers")
View Source
var ErrQueueFull = fmt.Errorf("queue is full")

Functions

This section is empty.

Types

type Queue

type Queue interface {
	Enqueue(func(context.Context)) error // Adds item to the queue
	Start()                              // Starts the processing of the queue
	Stop()                               // Stops the processing of the queue
	IsFull() bool
}

Queue encapsulates the Enqueue method that will be called by a dispatcher

func NewGenericQueue

func NewGenericQueue(ctx context.Context, numWorkers int, maxQueueSize int) (Queue, error)

func NewMockQueue added in v0.3.0

func NewMockQueue() Queue

Jump to

Keyboard shortcuts

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