hpx::supervision::discover_and_join#

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_and_join(registry const &local_registry, chrono::steady_duration const &timeout = default_discovery_timeout)#

Composes a single reactive discovery-and-join pass for supervision_dispatch peers: performs exactly one discover_peers() pull to resolve the pinned registry name of every remote locality (hpx::find_remote_localities() already excludes this locality, so no separate self-exclusion is needed here), then fans the resulting peer list out to local_registry via a single fan_out_join() pass.

discover_and_join() introduces no state, polling thread, timer, or repeated broadcast of its own - it is a pure composition of discover_peers() and fan_out_join(), each of which is itself bounded to a single round of resolution/join calls. Because fan_out_join() reuses registry::join()’s existing reservation/idempotency machinery unchanged (see server::registry::reserve_ownership()), calling discover_and_join() more than once - whether to pick up newly started peers or purely by accident - is safe and never creates more than one registry entry per peer locality; repeated invocations simply return the (stable) join epochs already owned for peers that were previously joined.

Parameters
  • local_registry – The registry to join every discovered peer to.

  • timeout – The maximum duration to wait, across all discovery candidates combined, for their registry name to resolve (see discover_peers()).

Returns

The discovered_peer value that local_registry created (or already had) for each peer discovered and successfully joined within timeout, in the same relative order as returned by discover_peers().