33typedef enum xtc_restart_strategy {
34 XTC_SUP_ONE_FOR_ONE = 0,
35 XTC_SUP_ONE_FOR_ALL = 1,
36 XTC_SUP_REST_FOR_ONE = 2,
37 XTC_SUP_SIMPLE_OFO = 3
38} xtc_restart_strategy_t;
40typedef enum xtc_restart_policy {
41 XTC_RESTART_PERMANENT = 0,
42 XTC_RESTART_TRANSIENT = 1,
43 XTC_RESTART_TEMPORARY = 2
44} xtc_restart_policy_t;
51typedef struct xtc_child_spec {
55 xtc_restart_policy_t policy;
62typedef struct xtc_sup_opts {
63 xtc_restart_strategy_t strategy;
66 struct xtc_exec *exec;
78#define XTC_SUP_OPTS_DEFAULT { \
79 .strategy = XTC_SUP_ONE_FOR_ONE, \
81 .period_ns = 5LL * 1000 * 1000 * 1000, \
86typedef struct xtc_supervisor xtc_supervisor_t;
103int xtc_sup_start(xtc_loop_t *loop,
107 xtc_supervisor_t **out_sup);
114int xtc_sup_stop(xtc_supervisor_t *sup);
129int xtc_sup_join(xtc_supervisor_t *sup, int64_t timeout_ns);
131int xtc_sup_n_children(
const xtc_supervisor_t *sup);
132int xtc_sup_n_alive(
const xtc_supervisor_t *sup);
133int xtc_sup_n_restarts(
const xtc_supervisor_t *sup);
134int xtc_sup_alive(
const xtc_supervisor_t *sup);