ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: samuel@oriontransfer.net
To: ruby-core@ruby-lang.org
Subject: [ruby-core:100862] [Ruby master Feature#17327] The Queue constructor should take an initial set of items
Date: Sun, 15 Nov 2020 22:50:14 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-88506.20201115225013.8671@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-17327.20201115220645.8671@ruby-lang.org

Issue #17327 has been updated by ioquatix (Samuel Williams).


That all makes sense to me.

----------------------------------------
Feature #17327: The Queue constructor should take an initial set of items
https://bugs.ruby-lang.org/issues/17327#change-88506

* 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/

  parent reply	other threads:[~2020-11-15 22:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-15 22:06 [ruby-core:100858] [Ruby master Feature#17327] The Queue constructor should take an initial set of items chris
2020-11-15 22:07 ` [ruby-core:100859] " chris
2020-11-15 22:11 ` [ruby-core:100860] " samuel
2020-11-15 22:13 ` [ruby-core:100861] " chris
2020-11-15 22:50 ` samuel [this message]
2020-11-16  9:11 ` [ruby-core:100870] " jean.boussier
2020-11-16 12:12 ` [ruby-core:100871] " ufuk
2020-12-09 11:04 ` [ruby-core:101339] " chris
2021-01-13  6:05 ` [ruby-core:102050] " matz
2021-01-29  8:50 ` [ruby-core:102290] " ko1

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-88506.20201115225013.8671@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).