lib/sensu/server/process.rb
def determine_matching_clients(clients, attributes)
        client_keys = clients.map { |client_name| "client:#{client_name}" }
        @redis.mget(*client_keys) do |client_json_objects|
          matching_clients = []
          client_json_objects.each do |client_json|
            unless client_json.nil?
              client = Sensu::JSON.load(client_json)
              if attributes_match?(client, attributes)
                matching_clients << client
              end
            end
          end
          yield(matching_clients)
        end
      end
# Determine and return clients from the registry that match a
# set of attributes.
#
# @param clients [Array] of client names.
# @param attributes [Hash]
# @yield [Array] callback/block called after determining the
#   matching clients, returning them as a block parameter.
Determine and return clients from the registry that match a
set of attributes.
Determine and return clients from the registry that match a set of attributes .
def determine_matching_clients(clients, attributes)
        client_keys = clients.map { |client_name| "client:#{client_name}" }
        @redis.mget(*client_keys) do |client_json_objects|
          matching_clients = []
          client_json_objects.each do |client_json|
            unless client_json.nil?
              client = Sensu::JSON.load(client_json)
              if attributes_match?(client, attributes)
                matching_clients << client
              end
            end
          end
          yield(matching_clients)
        end
      end
def determine_matching_clients ( clients , attributes ) client_keys = clients . map { | client_name | "client:#{client_name}" } @redis . mget ( * client_keys ) do | client_json_objects | matching_clients = [ ] client_json_objects . each do | client_json | unless client_json . nil? client = Sensu :: JSON . load ( client_json ) if attributes_match? ( client , attributes ) matching_clients << client end end end yield ( matching_clients ) end end
Determine and return clients from the registry that match a
set of attributes.
Determine and return clients from the registry that match a set of attributes .
clients
of client names.
of client names .
attributes
None
]
callback/block called after determining the matching clients, returning them as a block parameter.
callback / block called after determining the matching clients returning them as a block parameter .