Class: Sidekiq::Process

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

Overview

Sidekiq::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.



702
703
704
# File 'lib/sidekiq/api.rb', line 702

def initialize(hash)
  @attribs = hash
end

Instance Method Details

#[](key) ⇒ Object



714
715
716
# File 'lib/sidekiq/api.rb', line 714

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

#dump_threadsObject



726
727
728
# File 'lib/sidekiq/api.rb', line 726

def dump_threads
  signal('TTIN')
end

#labelsObject



710
711
712
# File 'lib/sidekiq/api.rb', line 710

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

#quiet!Object



718
719
720
# File 'lib/sidekiq/api.rb', line 718

def quiet!
  signal('USR1')
end

#stop!Object



722
723
724
# File 'lib/sidekiq/api.rb', line 722

def stop!
  signal('TERM')
end

#tagObject



706
707
708
# File 'lib/sidekiq/api.rb', line 706

def tag
  self['tag']
end