Project

General

Profile

Actions

Feature #17327

closed

The Queue constructor should take an initial set of items

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

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0