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' =>
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.
850 851 852 |
# File 'lib/sidekiq/api.rb', line 850 def initialize(hash) @attribs = hash end |
Instance Method Details
#[](key) ⇒ Object
862 863 864 |
# File 'lib/sidekiq/api.rb', line 862 def [](key) @attribs[key] end |
#dump_threads ⇒ Object
878 879 880 |
# File 'lib/sidekiq/api.rb', line 878 def dump_threads signal("TTIN") end |
#identity ⇒ Object
866 867 868 |
# File 'lib/sidekiq/api.rb', line 866 def identity self["identity"] end |
#labels ⇒ Object
858 859 860 |
# File 'lib/sidekiq/api.rb', line 858 def labels Array(self["labels"]) end |
#quiet! ⇒ Object
870 871 872 |
# File 'lib/sidekiq/api.rb', line 870 def quiet! signal("TSTP") end |
#stop! ⇒ Object
874 875 876 |
# File 'lib/sidekiq/api.rb', line 874 def stop! signal("TERM") end |
#stopping? ⇒ Boolean
882 883 884 |
# File 'lib/sidekiq/api.rb', line 882 def stopping? self["quiet"] == "true" end |
#tag ⇒ Object
854 855 856 |
# File 'lib/sidekiq/api.rb', line 854 def tag self["tag"] end |