From: samuel@... Date: 2020-11-15T22:11:16+00:00 Subject: [ruby-core:100860] [Ruby master Feature#17327] The Queue constructor should take an initial set of items Issue #17327 has been updated by ioquatix (Samuel Williams). What about a way to bulk add items, and maybe it would be best to have the first argument as an array, e.g. `Queue.new(worklist)`? I think it's more expensive to expand it in CRuby when you write `*worklist`. ---------------------------------------- Feature #17327: The Queue constructor should take an initial set of items https://bugs.ruby-lang.org/issues/17327#change-88504 * Author: chrisseaton (Chris Seaton) * Status: Open * Priority: Normal ---------------------------------------- I often create a `Queue` and then process it with a set of concurrent workers in threads. I end up writing: ```ruby q = Queue.new worklist.each do |work| q.push work end ``` I'd rather be able to write ```ruby q = Queue.new(*worklist) ``` -- https://bugs.ruby-lang.org/ Unsubscribe: