From 7d623489dd51667e0a2eec9d44aec57cb4c5ba44 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 26 Jan 2011 17:42:55 +0000 Subject: epoll/client: avoid unnecessary Epoll#set calls We should only attempt to modify the descriptor when we block, and not for subsequent events. --- lib/rainbows/epoll/client.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rainbows/epoll/client.rb b/lib/rainbows/epoll/client.rb index 2e45b26..a8eacab 100644 --- a/lib/rainbows/epoll/client.rb +++ b/lib/rainbows/epoll/client.rb @@ -147,11 +147,11 @@ module Rainbows::Epoll::Client when String buf = rv # retry when :wait_writable - break # queue + @wr_queue << buf.dup # >3-word 1.9 strings are copy-on-write + return EP.set(self, OUT) end while true end @wr_queue << buf.dup # >3-word 1.9 strings are copy-on-write - EP.set(self, OUT) end def close -- cgit v1.2.3-24-ge0c7