site-cookbooks/cluster_service_discovery/libraries/cluster_service_discovery.rb
def all_providers_for_service service_name
    search(:node, "provides_service:#{service_name}" ).
      find_all{|server| server[:provides_service][service_name] && server[:provides_service][service_name]['timestamp'] }.
      sort_by{|server| server[:provides_service][service_name]['timestamp'] } rescue []
  end
# Find all nodes that have indicated they provide the given service,
# in descending order of when they registered.
#
Find all nodes that have indicated they provide the given service,
in descending order of when they registered.
Find all nodes that have indicated they provide the given service in descending order of when they registered .
def all_providers_for_service service_name
    search(:node, "provides_service:#{service_name}" ).
      find_all{|server| server[:provides_service][service_name] && server[:provides_service][service_name]['timestamp'] }.
      sort_by{|server| server[:provides_service][service_name]['timestamp'] } rescue []
  end
def all_providers_for_service service_name search ( :node , "provides_service:#{service_name}" ) . find_all { | server | server [ :provides_service ] [ service_name ] && server [ :provides_service ] [ service_name ] [ 'timestamp' ] } . sort_by { | server | server [ :provides_service ] [ service_name ] [ 'timestamp' ] } rescue [ ] end
Find all nodes that have indicated they provide the given service,
in descending order of when they registered.
Find all nodes that have indicated they provide the given service in descending order of when they registered .
service_name