nx_event_queue.nx
buildroot/runtime/nx_event_queue.nx
about
nx_event_queue.nx -- substrate-level event dispatch primitive.
FIFO event queue with kind-based dispatching. Many primitives I've
shipped emit events (xenocell intrusion, treaty breach, health
transition, scam pattern). nx_event_queue is the generic substrate
for accumulating + dispatching those events to subscribers.
Composes:
nx_xenocell -- intrusion observations flow into events
nx_homeostasis -- migration signals flow into events
nx_health_check -- RED transitions flow into events
nx_book -- queue-drained events get journaled
V1 ships a single global queue per caller; multiplexing across
subscribers is the caller's job (V1 returns the next event by
kind filter).
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_crypto_event_compose_test.nxnx_event_queue_test.nx
structs
| 45 | struct NxEvent |
| 55 | struct NxEventQueue |
consts
| 27 | const NX_EV_NONE: nx_int = 0 |
| 28 | const NX_EV_XENO_OBSERVATION: nx_int = 1 |
| 29 | const NX_EV_HOMEOSTASIS_SIGNAL: nx_int = 2 |
| 30 | const NX_EV_HEALTH_TRANSITION: nx_int = 3 |
| 31 | const NX_EV_TREATY_BREACHED: nx_int = 4 |
| 32 | const NX_EV_SCAM_FLAGGED: nx_int = 5 |
| 33 | const NX_EV_RECOVERY_TRIGGERED: nx_int = 6 |
| 34 | const NX_EV_TWIN_KEY_DECISION: nx_int = 7 |
| 35 | const NX_EV_VESICLE_DELIVERED: nx_int = 8 |
| 36 | const NX_EV_N_KINDS: nx_int = 9 |
| 38 | const NX_EQ_OK: nx_int = 0 |
| 39 | const NX_EQ_ERR_FULL: nx_int = 1 |
| 40 | const NX_EQ_ERR_EMPTY: nx_int = 2 |
| 41 | const NX_EQ_ERR_BAD_KIND: nx_int = 3 |
| 64 | const NX_EV_BYTES: nx_size = 40 |
functions
| 66 | func nx_ev_kind_is_known(k: nx_int) -> nx_int called by 1: main |
| 72 | func nx_event_queue_new(capacity: nx_size) -> *NxEventQueue |
| 84 | func _ev_at(q: *NxEventQueue, idx: nx_size) -> *NxEvent |
| 90 | func nx_event_queue_emit(q: *NxEventQueue, |
| 115 | func nx_event_queue_drain_one(q: *NxEventQueue, |
| 136 | func nx_event_queue_peek_kind(q: *NxEventQueue) -> nx_int |
| 142 | func nx_event_queue_count(q: *NxEventQueue) -> nx_size called by 1: main |
| 146 | func nx_event_queue_total_emitted(q: *NxEventQueue) -> nx_int |
| 150 | func nx_event_queue_count_by_kind(q: *NxEventQueue, kind: nx_int) -> nx_int |