Class: OrigenSim::Heartbeat
- Inherits:
-
Thread
- Object
- Thread
- OrigenSim::Heartbeat
- Defined in:
- lib/origen_sim/heartbeat.rb
Instance Attribute Summary collapse
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
Instance Method Summary collapse
-
#initialize(socket) ⇒ Heartbeat
constructor
A new instance of Heartbeat.
- #stop ⇒ Object
Constructor Details
#initialize(socket) ⇒ Heartbeat
Returns a new instance of Heartbeat.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/origen_sim/heartbeat.rb', line 6 def initialize(socket) @socket = socket @continue = true super do while @continue socket.write("OK\n") sleep 5 end end end |
Instance Attribute Details
#socket ⇒ Object (readonly)
Returns the value of attribute socket.
4 5 6 |
# File 'lib/origen_sim/heartbeat.rb', line 4 def socket @socket end |
Instance Method Details
#stop ⇒ Object
17 18 19 |
# File 'lib/origen_sim/heartbeat.rb', line 17 def stop @continue = false end |