Class SizedQueue
In: lib/thread.rb
Parent: Queue

This class represents queues of specified size capacity. The push operation may be blocked if the capacity is full.

See Queue for an example of how a SizedQueue works.

Methods

<<   deq   enq   max   max=   new   num_waiting   pop   push   shift  

Public Class methods

Creates a fixed-length queue with a maximum size of max.

Public Instance methods

<<(obj)

Alias for push

deq(*args)

Alias for pop

enq(obj)

Alias for push

Returns the maximum size of the queue.

Sets the maximum size of the queue.

Returns the number of threads waiting on the queue.

Retrieves data from the queue and runs a waiting thread, if any.

Pushes obj to the queue. If there is no space left in the queue, waits until space becomes available.

shift(*args)

Alias for pop

To view or add comments on this documentation, please go to the API wiki.

[Validate]