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
Class
| Visibility | Signature |
|---|---|
| public | new (max) |
Instance
| Visibility | Signature |
|---|---|
| public | << (obj) |
| public | deq (*args) |
| public | enq (obj) |
| public | max () |
| public | max= (max) |
| public | num_waiting () |
| public | pop (*args) |
| public | push (obj) |
| public | shift (*args) |
Class Method Detail
new(max)
Creates a fixed-length queue with a maximum size of max.
Instance Method Detail
<<(obj)
Alias for push
deq(*args)
Alias for pop
enq(obj)
Alias for push
max()
Returns the maximum size of the queue.
max=(max)
Sets the maximum size of the queue.
num_waiting()
Returns the number of threads waiting on the queue.
pop(*args)
Retrieves data from the queue and runs a waiting thread, if any.
push(obj)
Pushes obj to the queue. If there is no space left in the queue, waits until space becomes available.
shift(*args)
Alias for pop