From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id E02F81F66F for ; Sun, 15 Nov 2020 22:50:19 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 08C95120B42; Mon, 16 Nov 2020 07:49:37 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id CDAAD120A0C for ; Mon, 16 Nov 2020 07:49:34 +0900 (JST) Received: by filterdrecv-p3mdw1-859677f5fd-7nt52 with SMTP id filterdrecv-p3mdw1-859677f5fd-7nt52-19-5FB1B0A6-18 2020-11-15 22:50:14.29302714 +0000 UTC m=+413523.951505434 Received: from herokuapp.com (unknown) by geopod-ismtpd-6-6 (SG) with ESMTP id 6ypG2OHTR82aeArzh32EEQ for ; Sun, 15 Nov 2020 22:50:14.221 +0000 (UTC) Date: Sun, 15 Nov 2020 22:50:14 +0000 (UTC) From: samuel@oriontransfer.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 76735 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 17327 X-Redmine-Issue-Author: chrisseaton X-Redmine-Sender: ioquatix X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?cjxb6GWHefMLoR50bkJBcGo6DRiDl=2FNYcMZdY+Wj30T0yIdDZHW59GCLtvIueS?= =?us-ascii?Q?HJKKzUvIlzlrwvrIl465HJ5cApGaqmcoJHe=2F2v5?= =?us-ascii?Q?P6li887gasXz+ZIJ75GYanKZQwAyZ8=2FjaZi31pe?= =?us-ascii?Q?JbWQjojKWU6FdyLfPsVRiZJcEvter7d4Rd=2FVqUK?= =?us-ascii?Q?TqkTZMgocGHLhee1WaFRi2cZe9F0b=2F2CF2HDj7=2F?= =?us-ascii?Q?T3BK80kXP7ySNhrcM=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 100862 Subject: [ruby-core:100862] [Ruby master Feature#17327] The Queue constructor should take an initial set of items X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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/