Module: Raemon::Worker::InstanceMethods
- Defined in:
- lib/raemon/worker.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#master ⇒ Object
readonly
Returns the value of attribute master.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#pulse ⇒ Object
readonly
Returns the value of attribute pulse.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/raemon/worker.rb', line 9 def id @id end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
9 10 11 |
# File 'lib/raemon/worker.rb', line 9 def logger @logger end |
#master ⇒ Object (readonly)
Returns the value of attribute master.
9 10 11 |
# File 'lib/raemon/worker.rb', line 9 def master @master end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
9 10 11 |
# File 'lib/raemon/worker.rb', line 9 def pid @pid end |
#pulse ⇒ Object (readonly)
Returns the value of attribute pulse.
9 10 11 |
# File 'lib/raemon/worker.rb', line 9 def pulse @pulse end |
Instance Method Details
#==(other_id) ⇒ Object
19 20 21 |
# File 'lib/raemon/worker.rb', line 19 def ==(other_id) @id == other_id end |
#heartbeat! ⇒ Object
27 28 29 |
# File 'lib/raemon/worker.rb', line 27 def heartbeat! master.worker_heartbeat!(self) end |
#initialize(master, id, pulse) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/raemon/worker.rb', line 11 def initialize(master, id, pulse) @master = master @logger = master.logger @id = id @pid = $$ @pulse = pulse end |
#run ⇒ Object
23 24 25 |
# File 'lib/raemon/worker.rb', line 23 def run raise "Abstract method" end |