rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob 6537ebc46948cc57b4563aba579eb18d4fd434dd 280 bytes (raw)
$ git show HEAD: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
 
# -*- encoding: binary -*-
# :enddoc:
class Rainbows::CoolioThreadPool::Watcher < Coolio::TimerWatcher
  def initialize(threads)
    @threads = threads
    super(Rainbows.server.timeout, true)
  end

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

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