Project

General

Profile

Actions

Feature #17327

closed

The Queue constructor should take an initial set of items

Added by chrisseaton (Chris Seaton) over 3 years ago. Updated about 3 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: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0