Sha256: 96ae83ca1dad85ef99d9d223b705d690253fdad6064bb468ce8f142c04ac5ca3
Contents?: true
Size: 451 Bytes
Versions: 20
Compression:
Stored size: 451 Bytes
Contents
require "timeout" module Invoker class CLI::Pinger attr_accessor :unix_client def initialize(unix_client) @unix_client = unix_client end def invoker_running? response = send_ping_and_read_response response && response.status == 'pong' end private def send_ping_and_read_response Timeout.timeout(2) { unix_client.send_and_receive('ping') } rescue Timeout::Error nil end end end
Version data entries
20 entries across 20 versions & 3 rubygems