about summary refs log tree commit homepage
path: root/lib/dtas/buffer/splice.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-31 01:19:43 +0000
committerEric Wong <e@80x24.org>2019-11-02 19:34:29 +0000
commit3fea3808526dab5875a2e5d23c7c8e7071223d6a (patch)
treeab2ece0420484eb63507efb34a25830bdde87413 /lib/dtas/buffer/splice.rb
parent98aa080df29b3ccc26bbe6bdcbfd6bbcda870ff4 (diff)
downloaddtas-3fea3808526dab5875a2e5d23c7c8e7071223d6a.tar.gz
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.
Diffstat (limited to 'lib/dtas/buffer/splice.rb')
-rw-r--r--lib/dtas/buffer/splice.rb10
1 files 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 = 65536
   F_MOVE = SleepyPenguin::F_MOVE
   F_NONBLOCK = SleepyPenguin::F_NONBLOCK
-  TRY = { exception: false }.freeze
 
   def buffer_size
     @to_io.pipe_size
@@ -32,7 +31,8 @@ module DTAS::Buffer::Splice # :nodoc:
   def broadcast_one(targets, limit = nil)
     # single output is always non-blocking
     limit ||= MAX_AT_ONCE_1
-    s = SleepyPenguin.splice(@to_io, targets[0], limit, F_MOVE|F_NONBLOCK, TRY)
+    s = SleepyPenguin.splice(@to_io, targets[0], limit, F_MOVE|F_NONBLOCK,
+                             exception: false)
     if Symbol === s
       targets # our one and only target blocked on write
     else
@@ -71,7 +71,8 @@ module DTAS::Buffer::Splice # :nodoc:
     targets.delete_if do |dst|
       begin
         t = (dst.nonblock? || most_teed == 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 === t
           if t > most_teed
@@ -119,7 +120,8 @@ module DTAS::Buffer::Splice # :nodoc:
     begin
       targets << last
       if last.nonblock? || most_teed == 0
-        s = SleepyPenguin.splice(@to_io, last, bytes, F_MOVE|F_NONBLOCK, TRY)
+        s = SleepyPenguin.splice(@to_io, last, bytes, F_MOVE|F_NONBLOCK,
+                                 exception: false)
         if Symbol === s
           blocked << last