nx_task.nx
buildroot/runtime/nx_task.nx
about
nx_task.nx -- MCP Tasks-primitive parity, sovereign: dispatch a long-running task (get a handle), POLL its status,
and retrieve the RESULT. State machine on seg_store via the canonical nx_registry (additive -> the full task history
is kept). Actual async execution composes nx_daemon (a worker daemon does the work then task_set ...done...). Record
(tab-separated): id <TAB> status <TAB> payload <TAB> result. status = pending | running | done | failed.
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_registry.nxnx_tabrec.nx
imported by: nx_task_gate.nx
structs
| none |
consts
| 8 | const TASK_MAGIC_4096: i64 = 4096 |
| 10 | const TASK_KP: *u8 = "task:" as *u8 |
| 11 | const TASK_IDX: *u8 = "__taskidx__" as *u8 |
| 12 | const TASK_PREFIX: *u8 = "knowledge/taskq-" as *u8 |
functions
| 15 | func task_dispatch_pfx(prefix: *u8, id: *u8, payload: *u8) -> i64 |
| 22 | func task_set_pfx(prefix: *u8, id: *u8, status: *u8, result: *u8) -> i64 |
| 35 | func task_status_pfx(prefix: *u8, id: *u8, sbuf: *u8) -> i64 |
| 45 | func task_get_pfx(prefix: *u8, id: *u8, ptrout: *i64, lenout: *i64) -> i64 { return reg_get(prefix, TASK_KP, id, ptrout, lenout) } |
| 46 | func task_list_pfx(prefix: *u8, idxbuf: *u8, cap: i64) -> i64 { return reg_index(prefix, TASK_IDX, idxbuf, cap) } calls 1: reg_index |
| 49 | func task_dispatch(id: *u8, payload: *u8) -> i64 { return task_dispatch_pfx(TASK_PREFIX, id, payload) } calls 1: task_dispatch_pfx |
| 50 | func task_set(id: *u8, status: *u8, result: *u8) -> i64 { return task_set_pfx(TASK_PREFIX, id, status, result) } calls 1: task_set_pfx |
| 51 | func task_status(id: *u8, sbuf: *u8) -> i64 { return task_status_pfx(TASK_PREFIX, id, sbuf) } calls 1: task_status_pfx |