Sha256: 0a5ded8f4e01c38c114adf4e29333f431f93f3970440f2b6bb542157c4b088ee
Contents?: true
Size: 897 Bytes
Versions: 20
Compression:
Stored size: 897 Bytes
Contents
module MCollective class Discovery class Mc def self.discover(filter, timeout, limit, client) begin hosts = [] Timeout.timeout(timeout) do reqid = client.sendreq("ping", "discovery", filter) Log.debug("Waiting #{timeout} seconds for discovery replies to request #{reqid}") loop do reply = client.receive(reqid) Log.debug("Got discovery reply from #{reply.payload[:senderid]}") hosts << reply.payload[:senderid] return hosts if limit > 0 && hosts.size == limit end end rescue Timeout::Error # rubocop:disable Lint/SuppressedException rescue Exception # rubocop:disable Lint/RescueException raise ensure client.unsubscribe("discovery", :reply) end hosts end end end end
Version data entries
20 entries across 20 versions & 1 rubygems