Class: Qs::Daemon::Signal
- Inherits:
-
Object
- Object
- Qs::Daemon::Signal
- Defined in:
- lib/qs/daemon.rb
Instance Method Summary collapse
- #halt? ⇒ Boolean
-
#initialize(value) ⇒ Signal
constructor
A new instance of Signal.
- #set(value) ⇒ Object
- #start? ⇒ Boolean
- #stop? ⇒ Boolean
Constructor Details
#initialize(value) ⇒ Signal
Returns a new instance of Signal.
327 328 329 330 |
# File 'lib/qs/daemon.rb', line 327 def initialize(value) @value = value @mutex = Mutex.new end |
Instance Method Details
#halt? ⇒ Boolean
344 345 346 |
# File 'lib/qs/daemon.rb', line 344 def halt? @mutex.synchronize{ @value == :halt } end |
#set(value) ⇒ Object
332 333 334 |
# File 'lib/qs/daemon.rb', line 332 def set(value) @mutex.synchronize{ @value = value } end |
#start? ⇒ Boolean
336 337 338 |
# File 'lib/qs/daemon.rb', line 336 def start? @mutex.synchronize{ @value == :start } end |
#stop? ⇒ Boolean
340 341 342 |
# File 'lib/qs/daemon.rb', line 340 def stop? @mutex.synchronize{ @value == :stop } end |