rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob 9b0e97ef09ff3e361b17ba302859e6d6802e3774 285 bytes (raw)
$ git show v2.1.0:lib/rainbows/coolio_thread_pool/watcher.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 
# -*- encoding: binary -*-
# :enddoc:
class Rainbows::CoolioThreadPool::Watcher < Coolio::TimerWatcher
  G = Rainbows::G

  def initialize(threads)
    @threads = threads
    super(G.server.timeout, true)
  end

  def on_timer
    @threads.each { |t| t.join(0) and G.quit! }
  end
end

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