1 # -*- encoding: binary -*-
3 module Rainbows::Coolio::Core
6 # runs inside each forked worker, this sits around and waits
7 # for connections and doesn't die until the parent dies (or is
8 # given a INT, QUIT, or TERM signal)
9 def worker_loop(worker)
10 init_worker_process(worker)
11 mod = Rainbows.const_get(@use)
12 rloop = Rainbows::Coolio::Server.const_set(:LOOP, Coolio::Loop.default)
13 Rainbows::Coolio::Server.const_set(:MAX, @worker_connections)
14 Rainbows::Coolio::Server.const_set(:CL, mod.const_get(:Client))
15 Rainbows::Coolio::Heartbeat.new(1, true).attach(rloop)
16 LISTENERS.map! { |s| Rainbows::Coolio::Server.new(s).attach(rloop) }