class Protobuf::Rpc::Connectors::Zmq

def zmq_eagain_error_check(return_code, source)

def zmq_eagain_error_check(return_code, source)
  return if ::ZMQ::Util.resultcode_ok?(return_code || -1)
  if ::ZMQ::Util.errno == ::ZMQ::EAGAIN
    fail ZmqEagainError, <<-ERROR
    Last ZMQ API call to #{source} failed with "#{::ZMQ::Util.error_string}".
    #{caller(1).join($INPUT_RECORD_SEPARATOR)}
    ERROR
  else
    fail <<-ERROR
    Last ZMQ API call to #{source} failed with "#{::ZMQ::Util.error_string}".
    #{caller(1).join($INPUT_RECORD_SEPARATOR)}
    ERROR
  end
end