Class: SizedQueue

Class | SizedQueue
In: | ext/fastthread/fastthread.c
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

clear empty? length max max= new num_waiting pop push

### Public Class methods

Mutex.new

Creates a new Mutex

### Public Instance methods

clear

Removes all objects from the queue.

empty?

Returns `true` if the queue is empty.

length

Returns the length of the queue.

max

Returns the maximum size of the queue.

max=(size)

Sets the maximum size of the queue.

num_waiting

Returns the number of threads waiting on the queue.

pop(...)

call_seq: pop(non_block=false)

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 an exception is raised.

push(obj)

Pushes `obj` to the queue.

[Validate]