hpx::supervision::discover_peers#

Defined in header hpx/supervision_dispatch.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

See also:

std::vector<discovered_peer> hpx::supervision::discover_peers(chrono::steady_duration const &timeout = default_discovery_timeout)#

Performs a one-time discovery pull for supervision_dispatch peers: concurrently resolves the pinned registry name (see register_name()) of every remote locality (hpx::find_remote_localities(), which already excludes this locality), bounded by a single wait for timeout across all candidates.

Because constructing a registry client from a symbolic name (see client_base’s symbolic-name constructor) waits/resolves once the symbol is bound rather than failing fast on one that is not (yet) registered, localities that never called register_name() (e.g. because they have not run init_supervision() yet) would otherwise hang this call indefinitely. Instead, once timeout elapses, only the candidates whose registry client was resolved by then (checked via the non-blocking is_ready()) are returned; every other candidate is simply excluded as not currently participating in supervision - discover_peers() itself never fails or throws on their account.

Parameters

timeout – The maximum duration to wait, across all candidates combined, for their registry names to resolve.

Returns

The peers whose registry client was resolved within timeout, as discovered_peer values carrying the hpx::id_type locality it is pinned to.