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.9 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 002711F66F for ; Sun, 15 Nov 2020 22:07:10 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 422221209CE; Mon, 16 Nov 2020 07:06:27 +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 342121209B7 for ; Mon, 16 Nov 2020 07:06:25 +0900 (JST) Received: by filterdrecv-p3iad2-6d658b4b48-xffhs with SMTP id filterdrecv-p3iad2-6d658b4b48-xffhs-20-5FB1A688-87 2020-11-15 22:07:04.877239526 +0000 UTC m=+169839.257831764 Received: from herokuapp.com (unknown) by ismtpd0067p1mdw1.sendgrid.net (SG) with ESMTP id AUT0bTy6Q7-oJhzzPj9k2w for ; Sun, 15 Nov 2020 22:07:04.759 +0000 (UTC) Date: Sun, 15 Nov 2020 22:07:04 +0000 (UTC) From: chris@chrisseaton.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 76732 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 17327 X-Redmine-Issue-Author: chrisseaton X-Redmine-Sender: chrisseaton 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?NC3uwXThXFpCxeI+EU+QkxuM4rZrp+UkiX2tCBF1HHuTc8=2FQ4a1eZIYcJM1tZp?= =?us-ascii?Q?H5aWGgZzHk=2FKFaJFiy7=2FC9KLerZFWN1CxOdV4c9?= =?us-ascii?Q?XItlwVgSe5XMqKz8lUl3EFK34GYoX2bZ6l5Cm+k?= =?us-ascii?Q?ADSN5pFqC0ob1A8qTFjHNCJR88Q41Pdlsu41EfW?= =?us-ascii?Q?PfCPO3fGpi1LqflioY0FfpQaVrD6xZ10kMOfpHP?= =?us-ascii?Q?f9v9QIw=2FcVArc80Zg=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 100859 Subject: [ruby-core:100859] [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 chrisseaton (Chris Seaton). https://github.com/ruby/ruby/pull/3768 ---------------------------------------- Feature #17327: The Queue constructor should take an initial set of items https://bugs.ruby-lang.org/issues/17327#change-88503 * 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/