about summary refs log tree commit homepage
path: root/lib/kgio.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-10-09 01:01:53 +0000
committerEric Wong <e@80x24.org>2015-10-09 21:54:19 +0000
commit64dc570f4b99f68b5ed792b36e7e8abc3df74927 (patch)
tree9c953120593bf303d90eda4c6d5afc0b0aa9691d /lib/kgio.rb
parent26d81c709a842c2435c2ef8acd47ffc0976978ed (diff)
downloadkgio-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.rb10
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