Starts, supervises and tears down the processes described by an expanded Mads::DirectorConfig. Foreground-only by design (see NEW_FEATURES.md P5): one call to run() drives the whole lifecycle and blocks until teardown completes.
More...
#include <up_supervisor.hpp>
Starts, supervises and tears down the processes described by an expanded Mads::DirectorConfig. Foreground-only by design (see NEW_FEATURES.md P5): one call to run() drives the whole lifecycle and blocks until teardown completes.
Definition at line 83 of file up_supervisor.hpp.
◆ UpSupervisor() [1/2]
◆ ~UpSupervisor()
| Mads::UpSupervisor::~UpSupervisor |
( |
| ) |
|
◆ UpSupervisor() [2/2]
◆ any_running()
| bool Mads::UpSupervisor::any_running |
( |
| ) |
const |
True if any managed process is currently running. Used after run() returns to assert teardown left no orphans.
◆ operator=()
◆ request_stop()
| void Mads::UpSupervisor::request_stop |
( |
| ) |
|
Thread-safe. Asks a running (or not-yet-started) supervisor to begin teardown at the next opportunity. Intended to be called from a signal handler installed by main().
◆ run()
Starts every enabled process in order (waiting on each one's ready probe before moving on to whatever depends on it), then monitors until a stop is requested (request_stop(), –until-exit's target exiting, –timeout elapsing, or a non-relaunch process dying with a non-zero exit code), then tears everything down in reverse start order. Blocking; safe to call exactly once per instance.
◆ start_count()
| int Mads::UpSupervisor::start_count |
( |
const std::string & |
name | ) |
const |
Number of times the named process instance has been started (1 after the first start, 2 after one relaunch, ...). 0 if never started/unknown.
◆ stop_requested()
| bool Mads::UpSupervisor::stop_requested |
( |
| ) |
const |
The documentation for this class was generated from the following file: