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.
734 735 736 |
# File 'lib/sidekiq/api.rb', line 734 def initialize(hash) @attribs = hash end |
Instance Method Details
#[](key) ⇒ Object
746 747 748 |
# File 'lib/sidekiq/api.rb', line 746 def [](key) @attribs[key] end |
#dump_threads ⇒ Object
758 759 760 |
# File 'lib/sidekiq/api.rb', line 758 def dump_threads signal('TTIN') end |
#labels ⇒ Object
742 743 744 |
# File 'lib/sidekiq/api.rb', line 742 def labels Array(self['labels']) end |
#quiet! ⇒ Object
750 751 752 |
# File 'lib/sidekiq/api.rb', line 750 def quiet! signal('USR1') end |
#stop! ⇒ Object
754 755 756 |
# File 'lib/sidekiq/api.rb', line 754 def stop! signal('TERM') end |
#stopping? ⇒ Boolean
762 763 764 |
# File 'lib/sidekiq/api.rb', line 762 def stopping? self['quiet'] == 'true' end |
#tag ⇒ Object
738 739 740 |
# File 'lib/sidekiq/api.rb', line 738 def tag self['tag'] end |