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
- #queues ⇒ Object
- #quiet! ⇒ Object
- #stop! ⇒ Object
- #stopping? ⇒ Boolean
- #tag ⇒ Object
Constructor Details
#initialize(hash) ⇒ Process
Returns a new instance of Process.
893 894 895 |
# File 'lib/sidekiq/api.rb', line 893 def initialize(hash) @attribs = hash end |
Instance Method Details
#[](key) ⇒ Object
905 906 907 |
# File 'lib/sidekiq/api.rb', line 905 def [](key) @attribs[key] end |
#dump_threads ⇒ Object
925 926 927 |
# File 'lib/sidekiq/api.rb', line 925 def dump_threads signal("TTIN") end |
#identity ⇒ Object
909 910 911 |
# File 'lib/sidekiq/api.rb', line 909 def identity self["identity"] end |
#labels ⇒ Object
901 902 903 |
# File 'lib/sidekiq/api.rb', line 901 def labels Array(self["labels"]) end |
#queues ⇒ Object
913 914 915 |
# File 'lib/sidekiq/api.rb', line 913 def queues self["queues"] end |
#quiet! ⇒ Object
917 918 919 |
# File 'lib/sidekiq/api.rb', line 917 def quiet! signal("TSTP") end |
#stop! ⇒ Object
921 922 923 |
# File 'lib/sidekiq/api.rb', line 921 def stop! signal("TERM") end |
#stopping? ⇒ Boolean
929 930 931 |
# File 'lib/sidekiq/api.rb', line 929 def stopping? self["quiet"] == "true" end |
#tag ⇒ Object
897 898 899 |
# File 'lib/sidekiq/api.rb', line 897 def tag self["tag"] end |