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>,

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Process

Returns a new instance of Process.



600
601
602
# File 'lib/sidekiq/api.rb', line 600

def initialize(hash)
  @attribs = hash
end

Instance Method Details

#[](key) ⇒ Object



612
613
614
# File 'lib/sidekiq/api.rb', line 612

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

#labelsObject



608
609
610
# File 'lib/sidekiq/api.rb', line 608

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

#quiet!Object



616
617
618
# File 'lib/sidekiq/api.rb', line 616

def quiet!
  signal('USR1')
end

#stop!Object



620
621
622
# File 'lib/sidekiq/api.rb', line 620

def stop!
  signal('TERM')
end

#tagObject



604
605
606
# File 'lib/sidekiq/api.rb', line 604

def tag
  self['tag']
end