Class

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.

Class Methods

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

Instance Methods
An alias for push

Removes all objects from the queue.

Similar to Queue#close.

The difference is behavior with waiting enqueuing threads.

If there are waiting enqueuing threads, they are interrupted by raising ClosedQueueError(‘queue closed’).

An alias for pop

Returns true if the queue is empty.

Returns the length of the queue.

Returns the maximum size of the queue.

Sets the maximum size of the queue to the given number.

Returns the number of threads waiting on the queue.

Retrieves data from the queue.

If the queue is empty, the calling thread is suspended until data is pushed onto the queue. If non_block is true, the thread isn’t suspended, and ThreadError is raised.

Pushes object to the queue.

If there is no space left in the queue, waits until space becomes available, unless non_block is true. If non_block is true, the thread isn’t suspended, and ThreadError is raised.

An alias for pop
An alias for length