job

package
v0.0.0-...-4ed146b Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// QueueBuffer is the buffer size that all job queues are using.
	QueueBuffer = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PendingJob

type PendingJob struct {
	Job            string
	Arguments      []lang.Value
	Realm          *realm.Realm
	ScriptOrModule interface{} // FIXME: 8.4, Table 24
	HostDefined    lang.InternalValue
}

PendingJob represents a pending job that is to be executed by an agent.

type Queue

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

Queue represents a JobQueue as specified in 8.4.

func NewQueue

func NewQueue() *Queue

NewQueue returns a new Queue.

func (*Queue) Dequeue

func (q *Queue) Dequeue() (PendingJob, bool)

Dequeue removes the first element from the queue and returns it.

func (*Queue) Enqueue

func (q *Queue) Enqueue(j PendingJob)

Enqueue adds a new PendingJob at the very end of the queue.

Jump to

Keyboard shortcuts

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