v0.8.2 Latest Latest

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 3 Imported by: 0



Package jobqueue is implemented based on eapache's infinite channel template: As explained by the author in documentation: due to Go's type system limitations direct import of his library is impractical. This reimplementation allows more type safety due to having more strict channel type than an empty interface. On top of better, even though slightly slower, queue as now it is thread-safe which is crucial as the queue can be read by multiple workers.



This section is empty.


This section is empty.


This section is empty.


type JobQueue

type JobQueue struct {
	// contains filtered or unexported fields

JobQueue represents a seemingly 'infinite' (depending on available memory) FIFO queue working on JobPacket items.

func New

func New() *JobQueue

New creates a new instance of a JobQueue.

func (*JobQueue) Close

func (ic *JobQueue) Close()

Close closes the input channel, however, output and hence the goroutine will be open until the queue is exhausted.

func (*JobQueue) In

func (ic *JobQueue) In() chan<- *jobpacket.JobPacket

In returns input channel for writing JobPackets.

func (*JobQueue) Len

func (ic *JobQueue) Len() int64

Len returns number of elements in the queue.

func (*JobQueue) Out

func (ic *JobQueue) Out() <-chan *jobpacket.JobPacket

Out returns output channel for reading JobPackets.

Jump to

Keyboard shortcuts

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