include/sig/runtime/sig_tap.h
typedef enum { SIG_TAP_INPUT, SIG_TAP_OUTPUT } sig_tap_direction;A tap observes every signal crossing a capsule terminal boundary: SIG_TAP_INPUT just before an input terminal's handler runs, SIG_TAP_OUTPUT when a capsule notifies an output terminal (whether or not it is routed anywhere). `terminal` and `signal` are borrowed for the duration of the call; copy what you keep. The function runs on the emitting service's (or loop's) thread and must not block.
typedef void (*sig_tap_fn)(void *ctx, const sig_service *service, const sig_capsule_instance *instance,
sig_tap_direction dir, const char *terminal, const sig_value *signal);