class Roundhouse::Process
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>,
}
Public Class Methods
new(hash)
click to toggle source
# File lib/roundhouse/api.rb, line 754 def initialize(hash) @attribs = hash end
Public Instance Methods
[](key)
click to toggle source
# File lib/roundhouse/api.rb, line 766 def [](key) @attribs[key] end
dump_threads()
click to toggle source
# File lib/roundhouse/api.rb, line 778 def dump_threads signal('TTIN') end
labels()
click to toggle source
# File lib/roundhouse/api.rb, line 762 def labels Array(self['labels']) end
quiet!()
click to toggle source
# File lib/roundhouse/api.rb, line 770 def quiet! signal('USR1') end
stop!()
click to toggle source
# File lib/roundhouse/api.rb, line 774 def stop! signal('TERM') end
tag()
click to toggle source
# File lib/roundhouse/api.rb, line 758 def tag self['tag'] end
Private Instance Methods
identity()
click to toggle source
# File lib/roundhouse/api.rb, line 794 def identity self['identity'] end
signal(sig)
click to toggle source
# File lib/roundhouse/api.rb, line 784 def signal(sig) key = "#{identity}-signals" Roundhouse.redis do |c| c.multi do c.lpush(key, sig) c.expire(key, 60) end end end