queue

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoding

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

func (*Encoding) Decode

func (e *Encoding) Decode(raw []byte) (*task.Task, error)

func (*Encoding) Encode

func (e *Encoding) Encode(t *task.Task) ([]byte, error)

type Queue

type Queue struct {
	sync.RWMutex

	BatchEnded chan bool

	Sink events.Sink
	// contains filtered or unexported fields
}

Queue struct use to put and get job items

func NewQueue

func NewQueue(sto storage.Storage, runner *run.Runner, sink events.Sink) Queue

NewQueue inits a new queue struct

func (*Queue) DequeueWhile

func (q *Queue) DequeueWhile()

DequeueWhile start maxDequeue workers while the queue is not empty

func (*Queue) Len

func (q *Queue) Len() int

Len of the current dequeue

func (*Queue) Put

func (q *Queue) Put(item *task.Task, env map[string]string) error

Put a new item into the queue and the storage

Jump to

Keyboard shortcuts

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