Sha256: f626ca6fe1e2206519e64eec632f06158561a5cd943e7906e6908768aa57636a
Contents?: true
Size: 481 Bytes
Versions: 27
Compression:
Stored size: 481 Bytes
Contents
# -*- encoding: binary -*- # :enddoc: require 'thread' class Rainbows::Coolio::Master < Coolio::IOWatcher def initialize(queue) @reader, @writer = Kgio::Pipe.new super(@reader) @queue = queue @wbuf, @rbuf = "\0", "\0" end def <<(output) @queue << output @writer.kgio_trywrite(@wbuf) end def on_readable if String === @reader.kgio_tryread(1, @rbuf) client, response = @queue.pop client.response_write(response) end end end
Version data entries
27 entries across 27 versions & 1 rubygems