End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Thread::SizedQueue#push
push(object, non_block=false, timeout: nil)
thread_sync.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/thread_sync.rb, line 59
def push(object, non_block = false, timeout: nil)
if non_block && timeout
raise ArgumentError, "can't set a timeout if non_block is enabled"
end
Primitive.rb_szqueue_push(object, non_block, timeout)
end
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.
Ruby version changes
-
3.2
-
Thread::SizedQueue#push(timeout: sec) is added. [Feature #18944]
-