lib/rainbows/writer_thread_pool.rb in rainbows-0.97.0 vs lib/rainbows/writer_thread_pool.rb in rainbows-1.0.0pre1
- old
+ new
@@ -18,23 +18,32 @@
# uploads, then using any HTTP-aware proxy like haproxy is fine.
# Using a non-HTTP-aware proxy will leave you vulnerable to
# slow client denial-of-service attacks.
module WriterThreadPool
+ # :stopdoc:
include 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:
- def readpartial(size, buf = "")
- to_io.readpartial(size, buf)
+ def kgio_addr
+ to_io.kgio_addr
end
- def write_nonblock(buf)
- to_io.write_nonblock(buf)
+ def kgio_read(size, buf = "")
+ to_io.kgio_read(size, buf)
end
+ def kgio_read!(size, buf = "")
+ to_io.kgio_read!(size, buf)
+ end
+
+ def kgio_trywrite(buf)
+ to_io.kgio_trywrite(buf)
+ end
+
def write(buf)
q << [ to_io, buf ]
end
def close
@@ -85,7 +94,8 @@
@@q = qp.map { |q| q.queue }
super(worker) # accept loop from Unicorn
qp.map { |q| q.quit! }
end
+ # :startdoc:
end
end