diff options
author | Eric Wong <e@80x24.org> | 2015-10-09 01:01:53 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-10-09 21:54:19 +0000 |
commit | 64dc570f4b99f68b5ed792b36e7e8abc3df74927 (patch) | |
tree | 9c953120593bf303d90eda4c6d5afc0b0aa9691d /lib/kgio.rb | |
parent | 26d81c709a842c2435c2ef8acd47ffc0976978ed (diff) | |
download | kgio-64dc570f4b99f68b5ed792b36e7e8abc3df74927.tar.gz |
This avoids breaking compatibility for existing apps, but is less performant (although safer and more resilient to future changes in Ruby) than the previous C version.
Diffstat (limited to 'lib/kgio.rb')
-rw-r--r-- | lib/kgio.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/kgio.rb b/lib/kgio.rb index f192074..2b420b0 100644 --- a/lib/kgio.rb +++ b/lib/kgio.rb @@ -17,14 +17,20 @@ module Kgio # :wait_writable when waiting for a read is required. WaitWritable = :wait_writable - # autopush is no-op nowadays + # autopush is strongly not recommended nowadays, use MSG_MORE instead @autopush = false class << self - attr_accessor :autopush # :nodoc: + attr_reader :autopush # :nodoc: def autopush? # :nodoc: !!@autopush end + + def autopush=(bool) # :nodoc: + # No require_relative, we remain 1.8-compatible + require 'kgio/autopush' + @autopush = bool + end end end |