queue

package
v0.0.0-...-6113c70 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance interface {
	// Push a task
	Push(task Task)
	// Run the loop until a signal on the channel
	Run(<-chan struct{})
}

Instance of work tickets processed using a rate-limiting loop

func NewQueue

func NewQueue(errorDelay time.Duration) Instance

type LKQueue

type LKQueue struct {
	// contains filtered or unexported fields
}

LKQueue is a lock-free unbounded queue.

func NewLKQueue

func NewLKQueue() *LKQueue

func (*LKQueue) Dequeue

func (q *LKQueue) Dequeue() interface{}

Dequeue removes and returns the value at the head of the queue. It returns nil if the queue is empty.

func (*LKQueue) Enqueue

func (q *LKQueue) Enqueue(v interface{})

Enqueue puts the given value v at the tail of the queue.

type Task

type Task func() error

Jump to

Keyboard shortcuts

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