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.



537
538
539
# File 'lib/sidekiq/api.rb', line 537

def initialize(hash)
  @attribs = hash
end

Instance Method Details

#[](key) ⇒ Object



541
542
543
# File 'lib/sidekiq/api.rb', line 541

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

#quiet!Object



545
546
547
# File 'lib/sidekiq/api.rb', line 545

def quiet!
  signal('USR1')
end

#stop!Object



549
550
551
# File 'lib/sidekiq/api.rb', line 549

def stop!
  signal('TERM')
end