rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob 0d8af8ca36c790b47874c5c6339585f682decc68 295 bytes (raw)
$ git show HEAD:lib/rainbows/coolio/server.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 
# -*- encoding: binary -*-
# :enddoc:
class Rainbows::Coolio::Server < Coolio::IO
  CONN = Rainbows::Coolio::CONN
  # CL and MAX will be defined in the corresponding worker loop

  def on_readable
    return if CONN.size >= MAX
    io = @_io.kgio_tryaccept and CL.new(io).attach(LOOP)
  end
end

git clone https://yhbt.net/rainbows.git