Class: Roundhouse::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/roundhouse/api.rb

Overview

Roundhouse::Process has a set of attributes which look like this:

'hostname' => 'app-1.example.com',
'started_at' => <process start time>,
'pid' => 12345,
'tag' => 'myapp'
'concurrency' => 25,
'queues' => ['default', 'low'],
'busy' => 10,
'beat' => <last heartbeat>,
'identity' => <unique string identifying the process>,

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Process

Returns a new instance of Process.



754
755
756
# File 'lib/roundhouse/api.rb', line 754

def initialize(hash)
  @attribs = hash
end

Instance Method Details

#[](key) ⇒ Object



766
767
768
# File 'lib/roundhouse/api.rb', line 766

def [](key)
  @attribs[key]
end

#dump_threadsObject



778
779
780
# File 'lib/roundhouse/api.rb', line 778

def dump_threads
  signal('TTIN')
end

#labelsObject



762
763
764
# File 'lib/roundhouse/api.rb', line 762

def labels
  Array(self['labels'])
end

#quiet!Object



770
771
772
# File 'lib/roundhouse/api.rb', line 770

def quiet!
  signal('USR1')
end

#stop!Object



774
775
776
# File 'lib/roundhouse/api.rb', line 774

def stop!
  signal('TERM')
end

#tagObject



758
759
760
# File 'lib/roundhouse/api.rb', line 758

def tag
  self['tag']
end