1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| | # -*- encoding: binary -*-
module Rainbows
module Rev
# This class handles the Unicorn fchmod heartbeat mechanism
# in Rev-based concurrency models to prevent the master
# process from killing us unless we're blocked. This class
# will also detect and execute the graceful exit if triggered
# by SIGQUIT
class Heartbeat < ::Rev::TimerWatcher
def on_timer
exit if (! G.tick && G.cur <= 0)
end
end
end
end
|