hpx::supervision::fan_out_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::fan_out_join(registry const &local_registry, std::vector<discovered_peer> const &peers, chrono::steady_duration const &timeout = default_discovery_timeout)#

Reactively fans out join() calls from local_registry to every peer in peers (typically the result of a prior discover_peers() call): for each entry, this calls local_registry.join(peer.locality).

This reuses registry::join()’s existing reservation/idempotency machinery unchanged (see server::registry::reserve_ownership()) rather than duplicating any of it, so calling fan_out_join() more than once with (partially) overlapping peer lists - or racing with an inbound join() call from one of those same peers, e.g. because that peer is concurrently running its own fan_out_join() against this locality - is safe and never creates more than one registry entry per peer locality.

fan_out_join() itself is reactive only: it performs exactly one round of join() calls for the given peers and starts no background/polling activity of its own.

Parameters
  • local_registry – The registry to join every peer in peers to.

  • peers – The peers to join, typically returned by a prior discover_peers() call.

  • timeout – The maximum duration to wait, across all peers combined, for their join() calls to settle. Peers whose join() has not settled (or failed) within this bound are silently dropped from the result, rather than hanging or throwing.

Returns

The discovered_peer values (locality + join_epoch) for peers whose join() calls settled successfully within timeout, in the same relative order as peers (with unsuccessful/ timed-out peers omitted, rather than left as gaps). Each returned discovered_peer::join_epoch is populated from the corresponding join() call, so callers can dispatch against {peer.locality, peer.join_epoch} directly, without needing a separate join() call to obtain it.