Skip to content
instance method

Thread::SizedQueue#<<

(Elem obj, ?::boolish non_block) -> void
(Elem obj, timeout: ::_ToF?) -> self?
<<(object)

Alias of #push

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.

If timeout seconds have passed and no space is available nil is returned. If timeout is 0 it returns immediately. Otherwise it returns self.

See also #push .new #clear #close also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1