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.



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

def initialize(hash)
  @attribs = hash
end

Instance Method Details

#[](key) ⇒ Object



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

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

#dump_threadsObject



738
739
740
# File 'lib/sidekiq/api.rb', line 738

def dump_threads
  signal('TTIN')
end

#labelsObject



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

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

#quiet!Object



730
731
732
# File 'lib/sidekiq/api.rb', line 730

def quiet!
  signal('USR1')
end

#stop!Object



734
735
736
# File 'lib/sidekiq/api.rb', line 734

def stop!
  signal('TERM')
end

#tagObject



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

def tag
  self['tag']
end