Sha256: 4763fe0d7d471671286f9c77ea70e9cb029ce9f5d1e39ed071d909b3218550a1
Contents?: true
Size: 661 Bytes
Versions: 2
Compression:
Stored size: 661 Bytes
Contents
require "micron/runner/liveness_checker/ping" require "micron/runner/liveness_checker/pong" module Micron class Runner class LivenessChecker include Debug def initialize @ping = IO.pipe @pong = IO.pipe end def ping(pid) @pinger = Ping.new(@pong.first, @ping.last, pid) @ping.first.close @pong.last.close end def pong @ponger = Pong.new(@ping.first, @pong.last) @ping.last.close @pong.first.close end def stop @pinger.thread.kill end def fds (@ping + @pong).map { |f| f.to_i } end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
micron-0.5.1 | lib/micron/runner/liveness_checker.rb |
micron-0.5.0 | lib/micron/runner/liveness_checker.rb |