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



700
701
702
# File 'lib/sidekiq/api.rb', line 700

def initialize(hash)
  @attribs = hash
end

Instance Method Details

#[](key) ⇒ Object



712
713
714
# File 'lib/sidekiq/api.rb', line 712

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

#labelsObject



708
709
710
# File 'lib/sidekiq/api.rb', line 708

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

#quiet!Object



716
717
718
# File 'lib/sidekiq/api.rb', line 716

def quiet!
  signal('USR1')
end

#stop!Object



720
721
722
# File 'lib/sidekiq/api.rb', line 720

def stop!
  signal('TERM')
end

#tagObject



704
705
706
# File 'lib/sidekiq/api.rb', line 704

def tag
  self['tag']
end