Class: Concurrent::Supervisor::WorkerContext
- Inherits:
-
Struct
- Object
- Struct
- Concurrent::Supervisor::WorkerContext
- Defined in:
- lib/concurrent/supervisor.rb
Instance Attribute Summary collapse
-
#restart ⇒ Object
Returns the value of attribute restart.
-
#terminated ⇒ Object
Returns the value of attribute terminated.
-
#thread ⇒ Object
Returns the value of attribute thread.
-
#type ⇒ Object
Returns the value of attribute type.
-
#worker ⇒ Object
Returns the value of attribute worker.
Instance Method Summary collapse
Instance Attribute Details
#restart ⇒ Object
Returns the value of attribute restart
19 20 21 |
# File 'lib/concurrent/supervisor.rb', line 19 def restart @restart end |
#terminated ⇒ Object
Returns the value of attribute terminated.
21 22 23 |
# File 'lib/concurrent/supervisor.rb', line 21 def terminated @terminated end |
#thread ⇒ Object
Returns the value of attribute thread.
20 21 22 |
# File 'lib/concurrent/supervisor.rb', line 20 def thread @thread end |
#type ⇒ Object
Returns the value of attribute type
19 20 21 |
# File 'lib/concurrent/supervisor.rb', line 19 def type @type end |
#worker ⇒ Object
Returns the value of attribute worker
19 20 21 |
# File 'lib/concurrent/supervisor.rb', line 19 def worker @worker end |
Instance Method Details
#alive? ⇒ Boolean
23 |
# File 'lib/concurrent/supervisor.rb', line 23 def alive?() return thread && thread.alive?; end |
#needs_restart? ⇒ Boolean
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/concurrent/supervisor.rb', line 25 def needs_restart? return false if thread && thread.alive? return false if terminated case self.restart when :permanent return true when :transient return thread.nil? || thread.status.nil? else #when :temporary return false end end |