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

[Validate]

ruby-doc.org is hosted and run by James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, Arizona. Ruby-doc.org was created in 2002 to promote the Ruby language and to help other Ruby hackers.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.