Project

General

Profile

Feature #10052

Add parameter non_block (defaults to false) on SizedQueue#push

Added by herwinw (Herwin Quarantainenet) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:63794]

Description

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) ruby10052_sized_queue_push_nonblock.diff herwinw (Herwin Quarantainenet), 07/17/2014 09:49 AM

Also available in: Atom PDF