about summary refs log tree commit homepage
path: root/lib/yahns/queue_kqueue.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yahns/queue_kqueue.rb')
-rw-r--r--lib/yahns/queue_kqueue.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/yahns/queue_kqueue.rb b/lib/yahns/queue_kqueue.rb
index 4e5c133..c0667b7 100644
--- a/lib/yahns/queue_kqueue.rb
+++ b/lib/yahns/queue_kqueue.rb
@@ -36,9 +36,14 @@ class Yahns::Queue < SleepyPenguin::Kqueue::IO # :nodoc:
     kevent(Kevent[io.fileno, flags, fflags, 0, 0, io])
   end
 
+  def queue_mod(io, flags)
+    kevent(Kevent[io.fileno, flags, ADD_ONESHOT, 0, 0, io])
+  end
+
   def thr_init
     Thread.current[:yahns_rbuf] = ""
     Thread.current[:yahns_fdmap] = @fdmap
+    Thread.current[:yahns_queue] = self
   end
 
   # returns an array of infinitely running threads