about summary refs log tree commit homepage
path: root/lib/kgio/autopush/sock_rw.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-12-15 22:53:48 +0000
committerEric Wong <e@80x24.org>2016-12-15 23:51:08 +0000
commit333347c3ae54c8d605c673fcd11ff8dcb2ea4c38 (patch)
tree0663faa01cb9f84457a1b55ab52867ed986dd64c /lib/kgio/autopush/sock_rw.rb
parent64dc570f4b99f68b5ed792b36e7e8abc3df74927 (diff)
downloadkgio-333347c3ae54c8d605c673fcd11ff8dcb2ea4c38.tar.gz
The regression for existing users was unnacceptable and
completely poor judgement on my part.  This change brings
us back to potentially not-future-compatible code which
will impose maintenance burdens on us in the face of
future Ruby changes.

But TODAY, it is the most performant option for folks who
need to use autopush.

Revert "resurrect Kgio.autopush support in pure Ruby"
and "remove autopush support and make it a no-op"

This reverts commits 64dc570f4b99f68b5ed792b36e7e8abc3df74927
and 4347980fa66115425fa8b765353c8b1bfe5dec24.
Diffstat (limited to 'lib/kgio/autopush/sock_rw.rb')
-rw-r--r--lib/kgio/autopush/sock_rw.rb68
1 files changed, 0 insertions, 68 deletions
diff --git a/lib/kgio/autopush/sock_rw.rb b/lib/kgio/autopush/sock_rw.rb
deleted file mode 100644
index 52f7a45..0000000
--- a/lib/kgio/autopush/sock_rw.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright (C) 2015 all contributors <kgio-public@bogomips.org>
-# License: LGPLv2.1 or later (https://www.gnu.org/licenses/lgpl-2.1.txt)
-
-# using this code is not recommended, for backwards compatibility only
-module Kgio::Autopush::SockRW # :nodoc:
-  include Kgio::Autopush
-
-  def kgio_read(*) # :nodoc:
-    kgio_push_pending_data
-    super
-  end
-
-  def kgio_read!(*) # :nodoc:
-    kgio_push_pending_data
-    super
-  end
-
-  def kgio_tryread(*) # :nodoc:
-    kgio_push_pending_data
-    super
-  end
-
-  def kgio_trypeek(*) # :nodoc:
-    kgio_push_pending_data
-    super
-  end
-
-  def kgio_peek(*) # :nodoc:
-    kgio_push_pending_data
-    super
-  end
-
-  def kgio_syssend(*) # :nodoc:
-    kgio_push_pending_data(super)
-  end if Kgio::SocketMethods.method_defined?(:kgio_syssend)
-
-  def kgio_trysend(*) # :nodoc:
-    kgio_ap_wrap_writer(super)
-  end
-
-  def kgio_trywrite(*) # :nodoc:
-    kgio_ap_wrap_writer(super)
-  end
-
-  def kgio_trywritev(*) # :nodoc:
-    kgio_ap_wrap_writer(super)
-  end
-
-  def kgio_write(*) # :nodoc:
-    kgio_ap_wrap_writer(super)
-  end
-
-  def kgio_writev(*) # :nodoc:
-    kgio_ap_wrap_writer(super)
-  end
-
-private
-
-  def kgio_ap_wrap_writer(rv) # :nodoc:
-    case rv
-    when :wait_readable, :wait_writable
-      kgio_push_pending_data
-    else
-      kgio_push_pending
-    end
-    rv
-  end
-end