[ruby-core:63799] [ruby-trunk - Feature #10052] Add parameter non_block (defaults to false) on SizedQueue#push

From: herwin@...
Date: 2014-07-17 09:50:37 UTC
List: ruby-core #63799
Issue #10052 has been updated by Herwin ..

File ruby10052_sized_queue_push_nonblock.diff added

The following patch should do the trick.

Another thing to consider in this file: don't mix up tabs and spaces. The indention is completely gone when viewing with a tabstop < 8.

----------------------------------------
Feature #10052: Add parameter non_block (defaults to false) on SizedQueue#push
https://bugs.ruby-lang.org/issues/10052#change-47830

* Author: Herwin .
* Status: Open
* Priority: Normal
* Assignee: 
* Category: ext
* Target version: 
----------------------------------------
The implementations of Queue and SizedQueue have a method pop, where a parameter non_block would make the call raise a ThreadError if the queue is empty. Since popping of an empty queue is comparable with pushing to a full SizedQueue, I guess it would be nice to have an optional second parameter to make SizedQueue#push optional non-blocking too.

---Files--------------------------------
ruby10052_sized_queue_push_nonblock.diff (2.03 KB)


-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next