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 identifying the process>,
Instance Method Summary collapse
- #[](key) ⇒ Object
- #dump_threads ⇒ Object
- #identity ⇒ 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.
796 797 798 |
# File 'lib/sidekiq/api.rb', line 796 def initialize(hash) @attribs = hash end |
Instance Method Details
#[](key) ⇒ Object
808 809 810 |
# File 'lib/sidekiq/api.rb', line 808 def [](key) @attribs[key] end |
#dump_threads ⇒ Object
824 825 826 |
# File 'lib/sidekiq/api.rb', line 824 def dump_threads signal('TTIN') end |
#identity ⇒ Object
812 813 814 |
# File 'lib/sidekiq/api.rb', line 812 def identity self['identity'] end |
#labels ⇒ Object
804 805 806 |
# File 'lib/sidekiq/api.rb', line 804 def labels Array(self['labels']) end |
#quiet! ⇒ Object
816 817 818 |
# File 'lib/sidekiq/api.rb', line 816 def quiet! signal('TSTP') end |
#stop! ⇒ Object
820 821 822 |
# File 'lib/sidekiq/api.rb', line 820 def stop! signal('TERM') end |
#stopping? ⇒ Boolean
828 829 830 |
# File 'lib/sidekiq/api.rb', line 828 def stopping? self['quiet'] == 'true' end |
#tag ⇒ Object
800 801 802 |
# File 'lib/sidekiq/api.rb', line 800 def tag self['tag'] end |