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

Version Path
rainbows-5.2.1 lib/rainbows/coolio/master.rb
rainbows-5.2.0 lib/rainbows/coolio/master.rb
rainbows-5.1.1 lib/rainbows/coolio/master.rb
rainbows-5.1.0 lib/rainbows/coolio/master.rb
rainbows-5.0.0.5.ge717 lib/rainbows/coolio/master.rb
rainbows-5.0.0 lib/rainbows/coolio/master.rb
rainbows-4.7.0 lib/rainbows/coolio/master.rb
rainbows-4.6.2 lib/rainbows/coolio/master.rb
rainbows-4.6.1 lib/rainbows/coolio/master.rb
rainbows-4.6.0.4.g4108 lib/rainbows/coolio/master.rb
rainbows-4.6.0 lib/rainbows/coolio/master.rb
rainbows-4.5.0 lib/rainbows/coolio/master.rb
rainbows-4.4.3 lib/rainbows/coolio/master.rb
rainbows-4.4.2 lib/rainbows/coolio/master.rb
rainbows-4.4.1.1.gd5c8c lib/rainbows/coolio/master.rb
rainbows-4.4.1 lib/rainbows/coolio/master.rb
rainbows-4.4.0 lib/rainbows/coolio/master.rb
rainbows-4.3.1 lib/rainbows/coolio/master.rb
rainbows-4.3.0 lib/rainbows/coolio/master.rb
rainbows-4.2.0 lib/rainbows/coolio/master.rb