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 requestqueue 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 RequestQueue

type RequestQueue struct {
	// contains filtered or unexported fields

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

func New

func New() *RequestQueue

New creates a new instance of a RequestQueue.

func (*RequestQueue) Close

func (ic *RequestQueue) Close()

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

func (*RequestQueue) In

func (ic *RequestQueue) In() chan<- *commands.CommandRequest

In returns input channel for writing CommandRequests.

func (*RequestQueue) Len

func (ic *RequestQueue) Len() int64

Len returns number of elements in the queue.

func (*RequestQueue) Out

func (ic *RequestQueue) Out() <-chan *commands.CommandRequest

Out returns output channel for reading CommandRequests.

Jump to

Keyboard shortcuts

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