Class: Sidekiq::Process
- Inherits:
-
Object
- Object
- Sidekiq::Process
- 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
- #[](key) ⇒ Object
-
#initialize(hash) ⇒ Process
constructor
A new instance of Process.
- #labels ⇒ Object
- #quiet! ⇒ Object
- #stop! ⇒ Object
- #tag ⇒ Object
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 |
#labels ⇒ Object
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 |
#tag ⇒ Object
604 605 606 |
# File 'lib/sidekiq/api.rb', line 604 def tag self['tag'] end |