Class: Sidekiq::Process
- Inherits:
-
Object
- Object
- Sidekiq::Process
- Defined in:
- lib/sidekiq/api.rb
Overview
Sidekiq::Process represents an active Sidekiq process talking with Redis. Each 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 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
- #stopping? ⇒ Boolean
- #tag ⇒ Object
Constructor Details
#initialize(hash) ⇒ Process
Returns a new instance of Process.
761 762 763 |
# File 'lib/sidekiq/api.rb', line 761 def initialize(hash) @attribs = hash end |
Instance Method Details
#[](key) ⇒ Object
773 774 775 |
# File 'lib/sidekiq/api.rb', line 773 def [](key) @attribs[key] end |
#dump_threads ⇒ Object
785 786 787 |
# File 'lib/sidekiq/api.rb', line 785 def dump_threads signal('TTIN') end |
#labels ⇒ Object
769 770 771 |
# File 'lib/sidekiq/api.rb', line 769 def labels Array(self['labels']) end |
#quiet! ⇒ Object
777 778 779 |
# File 'lib/sidekiq/api.rb', line 777 def quiet! signal('TSTP') end |
#stop! ⇒ Object
781 782 783 |
# File 'lib/sidekiq/api.rb', line 781 def stop! signal('TERM') end |
#stopping? ⇒ Boolean
789 790 791 |
# File 'lib/sidekiq/api.rb', line 789 def stopping? self['quiet'] == 'true' end |
#tag ⇒ Object
765 766 767 |
# File 'lib/sidekiq/api.rb', line 765 def tag self['tag'] end |