diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-10-06 11:29:50 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-10-06 11:29:50 +0000 |
commit | 10b6447a38c4f82951ff137335895c9067f36bc6 (patch) | |
tree | 1edd2229560e864b83a6bfd4c2f3bd4fc9530fbe /lib | |
parent | 019543aa3a1074582a460b944ad5ebcddecd4394 (diff) | |
download | dtas-10b6447a38c4f82951ff137335895c9067f36bc6.tar.gz |
We never change the I/O directly, so avoid the expensive syscall and only use a slightly-expensive Ruby method call instead (the Ruby method call is fixed cost in either case).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dtas/pipe.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/dtas/pipe.rb b/lib/dtas/pipe.rb index 41783d3..a4ce57c 100644 --- a/lib/dtas/pipe.rb +++ b/lib/dtas/pipe.rb @@ -22,6 +22,11 @@ class DTAS::Pipe < IO # :nodoc: def pipe_size=(_) end end + + # avoid syscall, we never change IO#nonblock= directly + def nonblock? + false + end end # for non-blocking sinks, this avoids extra fcntl(..., F_GETFL) syscalls |