queue

package
v0.0.0-...-5c5d71a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: GPL-3.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 Queue

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

Queue holds name, list of actions and context with cancel.

func NewQueue

func NewQueue() *Queue

NewQueue instantiates new queue.

func (*Queue) AddAction

func (q *Queue) AddAction(Action func())

AddAction sends Action to the channel.

func (*Queue) Addactions

func (q *Queue) Addactions(actions map[string]func())

Addactions adds actions to the queue and cancels channel.

type Worker

type Worker struct {
	Queue *Queue
}

Worker responsible for queue serving.

func NewWorker

func NewWorker(queue *Queue) *Worker

NewWorker initializes a new Worker.

func (*Worker) Execute

func (w *Worker) Execute() bool

Execute processes actions from the queue (actions channel).

Jump to

Keyboard shortcuts

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