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-ASN: AS22989 209.51.188.0/24 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, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 12AD01F4C0 for ; Thu, 31 Oct 2019 10:06:05 +0000 (UTC) Received: from localhost ([::1]:48036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQ7L8-0002Dq-FS for e@80x24.org; Thu, 31 Oct 2019 06:06:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37832) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQ7GY-0005wS-AF for dtas-all@nongnu.org; Thu, 31 Oct 2019 06:01:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQ7GT-0005bk-9w for dtas-all@nongnu.org; Thu, 31 Oct 2019 06:01:18 -0400 Received: from dcvr.yhbt.net ([64.71.152.64]:37422) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iQ7GT-0005Zq-4J for dtas-all@nongnu.org; Thu, 31 Oct 2019 06:01:13 -0400 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8F0021F4C4 for ; Thu, 31 Oct 2019 10:00:55 +0000 (UTC) From: Eric Wong To: dtas-all@nongnu.org Subject: [PATCH 3/3] buffer/splice: pass kwargs as-is to tee/splice Date: Thu, 31 Oct 2019 10:00:54 +0000 Message-Id: <20191031100054.13415-4-e@80x24.org> In-Reply-To: <20191031100054.13415-1-e@80x24.org> References: <20191031100054.13415-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.71.152.64 X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: duct tape audio suite List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+e=80x24.org@nongnu.org Sender: "dtas-all" Ruby 2.7.0dev will warn when hashes are passed and intended for use as kwargs unless we expand the hash via "**TRY", but "**" is Ruby 2.0+ syntax and I guess we still support 1.9.3 for the time being. --- lib/dtas/buffer/splice.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/dtas/buffer/splice.rb b/lib/dtas/buffer/splice.rb index 281ecfd..2e86d0a 100644 --- a/lib/dtas/buffer/splice.rb +++ b/lib/dtas/buffer/splice.rb @@ -12,7 +12,6 @@ module DTAS::Buffer::Splice # :nodoc: MAX_AT_ONCE_1 =3D 65536 F_MOVE =3D SleepyPenguin::F_MOVE F_NONBLOCK =3D SleepyPenguin::F_NONBLOCK - TRY =3D { exception: false }.freeze =20 def buffer_size @to_io.pipe_size @@ -32,7 +31,8 @@ def discard(bytes) def broadcast_one(targets, limit =3D nil) # single output is always non-blocking limit ||=3D MAX_AT_ONCE_1 - s =3D SleepyPenguin.splice(@to_io, targets[0], limit, F_MOVE|F_NONBL= OCK, TRY) + s =3D SleepyPenguin.splice(@to_io, targets[0], limit, F_MOVE|F_NONBL= OCK, + exception: false) if Symbol =3D=3D=3D s targets # our one and only target blocked on write else @@ -71,7 +71,8 @@ def __broadcast_tee(blocked, targets, chunk_size) targets.delete_if do |dst| begin t =3D (dst.nonblock? || most_teed =3D=3D 0) ? - SleepyPenguin.tee(@to_io, dst, chunk_size, F_NONBLOCK, TRY) = : + SleepyPenguin.tee(@to_io, dst, chunk_size, F_NONBLOCK, + exception: false) : __tee_in_full(@to_io, dst, chunk_size) if Integer =3D=3D=3D t if t > most_teed @@ -119,7 +120,8 @@ def broadcast_inf(targets, limit =3D nil) begin targets << last if last.nonblock? || most_teed =3D=3D 0 - s =3D SleepyPenguin.splice(@to_io, last, bytes, F_MOVE|F_NONBLOC= K, TRY) + s =3D SleepyPenguin.splice(@to_io, last, bytes, F_MOVE|F_NONBLOC= K, + exception: false) if Symbol =3D=3D=3D s blocked << last =20