Class: Micron::Runner::LivenessChecker::Pong
- Inherits:
-
Object
- Object
- Micron::Runner::LivenessChecker::Pong
- Includes:
- Debug
- Defined in:
- lib/micron/runner/liveness_checker/pong.rb
Instance Attribute Summary collapse
-
#thread ⇒ Object
readonly
Returns the value of attribute thread.
Instance Method Summary collapse
-
#initialize(reader, writer) ⇒ Pong
constructor
A new instance of Pong.
Methods included from Debug
Constructor Details
#initialize(reader, writer) ⇒ Pong
Returns a new instance of Pong.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/micron/runner/liveness_checker/pong.rb', line 11 def initialize(reader, writer) @thread = Thread.new(reader, writer) { |reader, writer| Thread.current[:name] = "ponger" debug "thread started" begin writer.sync = true while line = reader.readline debug "got ping request, replying" writer.puts "pong" end rescue Exception => ex debug "caught error: #{Micron.dump_ex(ex)}" end debug "thread exiting from #{$$}" } end |
Instance Attribute Details
#thread ⇒ Object (readonly)
Returns the value of attribute thread.
9 10 11 |
# File 'lib/micron/runner/liveness_checker/pong.rb', line 9 def thread @thread end |