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 | |
parent | e7d295fd8e3628eba7a1ba52e95b7dee11532e98 (diff) | |
download | rainbows-6ae020c9ac483d822902b5d33f038f79b44d3a50.tar.gz |
Use a consistent "Client" naming to reduce confusion
Diffstat (limited to 'lib/rainbows/writer_thread_pool')
-rw-r--r-- | lib/rainbows/writer_thread_pool/client.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/rainbows/writer_thread_pool/client.rb b/lib/rainbows/writer_thread_pool/client.rb new file mode 100644 index 0000000..5889e84 --- /dev/null +++ b/lib/rainbows/writer_thread_pool/client.rb @@ -0,0 +1,19 @@ +# -*- encoding: binary -*- +# +# used to wrap a BasicSocket to use with +q+ for all writes +# this is compatible with IO.select +class Rainbows::WriterThreadPool::Client < 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 |