Class: Qs::Daemon::Signal

Inherits:
Object
  • Object
show all
Defined in:
lib/qs/daemon.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Signal



367
368
369
370
# File 'lib/qs/daemon.rb', line 367

def initialize(value)
  @value = value
  @mutex = Mutex.new
end

Instance Method Details

#halt?Boolean



384
385
386
# File 'lib/qs/daemon.rb', line 384

def halt?
  @mutex.synchronize{ @value == :halt }
end

#set(value) ⇒ Object



372
373
374
# File 'lib/qs/daemon.rb', line 372

def set(value)
  @mutex.synchronize{ @value = value }
end

#start?Boolean



376
377
378
# File 'lib/qs/daemon.rb', line 376

def start?
  @mutex.synchronize{ @value == :start }
end

#stop?Boolean



380
381
382
# File 'lib/qs/daemon.rb', line 380

def stop?
  @mutex.synchronize{ @value == :stop }
end