diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-12-27 02:30:58 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-12-27 02:30:58 +0000 |
commit | 6ae020c9ac483d822902b5d33f038f79b44d3a50 (patch) | |
tree | 98b1ef14929bb868cb3cf32867c4e0962ee91432 /lib/rainbows/writer_thread_pool.rb | |
parent | e7d295fd8e3628eba7a1ba52e95b7dee11532e98 (diff) | |
download | rainbows-6ae020c9ac483d822902b5d33f038f79b44d3a50.tar.gz |
Use a consistent "Client" naming to reduce confusion
Diffstat (limited to 'lib/rainbows/writer_thread_pool.rb')
-rw-r--r-- | lib/rainbows/writer_thread_pool.rb | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/lib/rainbows/writer_thread_pool.rb b/lib/rainbows/writer_thread_pool.rb index e4e0228..6896787 100644 --- a/lib/rainbows/writer_thread_pool.rb +++ b/lib/rainbows/writer_thread_pool.rb @@ -20,24 +20,6 @@ module Rainbows::WriterThreadPool # :stopdoc: include Rainbows::Base - # used to wrap a BasicSocket to use with +q+ for all writes - # this is compatible with IO.select - class QueueSocket < Struct.new(:to_io, :q) # :nodoc: - include Rainbows::SocketProxy - - def write(buf) - q << [ to_io, buf ] - end - - def close - q << [ to_io, :close ] - end - - def closed? - false - end - end - @@nr = 0 @@q = nil @@ -47,7 +29,7 @@ module Rainbows::WriterThreadPool def process_client(client) # :nodoc: @@nr += 1 - super(QueueSocket.new(client, @@q[@@nr %= @@q.size])) + super(Client.new(client, @@q[@@nr %= @@q.size])) end def init_worker_process(worker) @@ -82,3 +64,5 @@ module Rainbows::WriterThreadPool end # :startdoc: end +# :enddoc: +require 'rainbows/writer_thread_pool/client' |