Project

General

Profile

Actions

Feature #17327

closed

The Queue constructor should take an initial set of items

Feature #17327: The Queue constructor should take an initial set of items

Added by chrisseaton (Chris Seaton) almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Target version:
-
[ruby-core:100858]

Description

I often create a Queue and then process it with a set of concurrent workers in threads. I end up writing:

q = Queue.new
worklist.each do |work|
  q.push work
end

I'd rather be able to write

q = Queue.new(*worklist)
Actions

Also available in: PDF Atom