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.



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

def initialize(hash)
  @attribs = hash
end

Instance Method Details

#[](key) ⇒ Object



633
634
635
# File 'lib/sidekiq/api.rb', line 633

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

#labelsObject



629
630
631
# File 'lib/sidekiq/api.rb', line 629

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

#quiet!Object



637
638
639
# File 'lib/sidekiq/api.rb', line 637

def quiet!
  signal('USR1')
end

#stop!Object



641
642
643
# File 'lib/sidekiq/api.rb', line 641

def stop!
  signal('TERM')
end

#tagObject



625
626
627
# File 'lib/sidekiq/api.rb', line 625

def tag
  self['tag']
end