hpx::supervision::testing::stop_background_loops#

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:

void hpx::supervision::testing::stop_background_loops()#

Stops this locality’s failure_detection_loop() and heartbeat_loop() background tasks (joining both) without otherwise finalizing the dispatcher: unlike finalize(), this never publishes event::completed, never unregisters the registry symbol name, and never resets the lifecycle state back to uninitialized, so the sentinel’s last published event stays stale and peers’ failure_detection_loop() still eventually times out and observes target_fenced/rejected_fenced against this locality. Lets a caller depart the HPX runtime cleanly (e.g. via hpx::disconnect()) afterwards without leaving either background hpx::async task still running - simulating a worker that dies mid-epoch without corrupting AGAS or hanging runtime shutdown, as opposed to a true crash (no call at all) or a fully graceful departure (finalize()). Idempotent; no-op if init() was never called or the loops are already stopped. Not part of the public dispatch API - exists only for examples/tests that need to simulate this exact scenario deterministically.