Project

General

Profile

Actions

Feature #6293

open

new queue / blocking queues

Added by tenderlovemaking (Aaron Patterson) about 12 years ago. Updated over 6 years ago.

Status:
Assigned
Target version:
-
[ruby-core:44349]

Description

Hi,

I'd like to add new Queue objects to ruby. Whenever I use queues, I either use them in a blocking or non-blocking manner only, so I have separated them in to two classes Thread::Queue, and Thread::BlockingQueue.

Other notable differences, these queues:

  • implement poll, which will return a nil if the queue is empty
  • do not allow nil to be in the queue as it would interfere with poll
  • include Enumerable

I think these will be a good basis for implementing a Deque, SynchronizedQueue, and PriorityQueue.

I've attached a patch against trunk.


Files

queue.patch (11.6 KB) queue.patch tenderlovemaking (Aaron Patterson), 04/14/2012 08:28 AM
noname (500 Bytes) noname Anonymous, 04/14/2012 11:23 AM
noname (500 Bytes) noname Anonymous, 04/14/2012 11:29 AM
noname (500 Bytes) noname Anonymous, 04/17/2012 12:29 AM
queue.patch (11.4 KB) queue.patch Anonymous, 04/21/2012 07:59 AM
noname (500 Bytes) noname Anonymous, 04/21/2012 07:59 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0