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.



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

def initialize(hash)
  @attribs = hash
end

Instance Method Details

#[](key) ⇒ Object



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

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

#dump_threadsObject



728
729
730
# File 'lib/sidekiq/api.rb', line 728

def dump_threads
  signal('TTIN')
end

#labelsObject



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

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

#quiet!Object



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

def quiet!
  signal('USR1')
end

#stop!Object



724
725
726
# File 'lib/sidekiq/api.rb', line 724

def stop!
  signal('TERM')
end

#tagObject



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

def tag
  self['tag']
end