32typedef enum xtc_restart_strategy {
33 XTC_SUP_ONE_FOR_ONE = 0,
34 XTC_SUP_ONE_FOR_ALL = 1,
35 XTC_SUP_REST_FOR_ONE = 2,
36 XTC_SUP_SIMPLE_OFO = 3
37} xtc_restart_strategy_t;
39typedef enum xtc_restart_policy {
40 XTC_RESTART_PERMANENT = 0,
41 XTC_RESTART_TRANSIENT = 1,
42 XTC_RESTART_TEMPORARY = 2
43} xtc_restart_policy_t;
50typedef struct xtc_child_spec {
54 xtc_restart_policy_t policy;
61typedef struct xtc_sup_opts {
62 xtc_restart_strategy_t strategy;
65 struct xtc_exec *exec;
71#define XTC_SUP_OPTS_DEFAULT { \
72 .strategy = XTC_SUP_ONE_FOR_ONE, \
74 .period_ns = 5LL * 1000 * 1000 * 1000, \
78typedef struct xtc_supervisor xtc_supervisor_t;
94int xtc_sup_start(xtc_loop_t *loop,
98 xtc_supervisor_t **out_sup);
105int xtc_sup_stop(xtc_supervisor_t *sup);
120int xtc_sup_join(xtc_supervisor_t *sup, int64_t timeout_ns);
122int xtc_sup_n_children(
const xtc_supervisor_t *sup);
123int xtc_sup_n_restarts(
const xtc_supervisor_t *sup);
124int xtc_sup_alive(
const xtc_supervisor_t *sup);