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>,
'identity' => <unique string identifying the process>,
Instance Method Summary collapse
- #[](key) ⇒ Object
- #dump_threads ⇒ 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.
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_threads ⇒ Object
728 729 730 |
# File 'lib/sidekiq/api.rb', line 728 def dump_threads signal('TTIN') end |
#labels ⇒ Object
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 |
#tag ⇒ Object
708 709 710 |
# File 'lib/sidekiq/api.rb', line 708 def tag self['tag'] end |