Class: AfterNotifier::PidGuard
- Inherits:
-
Object
- Object
- AfterNotifier::PidGuard
- Defined in:
- lib/after_notifier/pid_guard.rb
Constant Summary collapse
- SLEEP_TIME =
2
Instance Method Summary collapse
- #finished? ⇒ Boolean
-
#initialize(pid) ⇒ PidGuard
constructor
A new instance of PidGuard.
Constructor Details
#initialize(pid) ⇒ PidGuard
Returns a new instance of PidGuard.
7 8 9 |
# File 'lib/after_notifier/pid_guard.rb', line 7 def initialize(pid) @pid = pid.to_i end |
Instance Method Details
#finished? ⇒ Boolean
11 12 13 14 15 16 17 18 19 |
# File 'lib/after_notifier/pid_guard.rb', line 11 def finished? # At first PID should be exisited. raise UnknownPid, 'Should set exist PID' unless exists? loop do return true unless exists? sleep SLEEP_TIME end end |