code wiki / (root) / nx_task.nx

nx_task.nx

buildroot/runtime/nx_task.nx

3095 B51 linesdepth 6pulls 8 transitivereach 1 importersview sourcekind librarytopic task
docsdependenciesstructsconstsfunctions

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

nx_registry.nx nx_tabrec.nx nx_task.nx nx_task_gate.nx

imports: nx_registry.nxnx_tabrec.nx

imported by: nx_task_gate.nx

structs

none

consts

8const TASK_MAGIC_4096: i64 = 4096
10const TASK_KP: *u8 = "task:" as *u8
11const TASK_IDX: *u8 = "__taskidx__" as *u8
12const TASK_PREFIX: *u8 = "knowledge/taskq-" as *u8

functions

15func task_dispatch_pfx(prefix: *u8, id: *u8, payload: *u8) -> i64
22func task_set_pfx(prefix: *u8, id: *u8, status: *u8, result: *u8) -> i64
35func task_status_pfx(prefix: *u8, id: *u8, sbuf: *u8) -> i64
called by 2: task_statusmain calls 2: reg_gettr_field
45func task_get_pfx(prefix: *u8, id: *u8, ptrout: *i64, lenout: *i64) -> i64 { return reg_get(prefix, TASK_KP, id, ptrout, lenout) }
called by 1: main calls 1: reg_get
46func task_list_pfx(prefix: *u8, idxbuf: *u8, cap: i64) -> i64 { return reg_index(prefix, TASK_IDX, idxbuf, cap) }
calls 1: reg_index
49func task_dispatch(id: *u8, payload: *u8) -> i64 { return task_dispatch_pfx(TASK_PREFIX, id, payload) }
50func task_set(id: *u8, status: *u8, result: *u8) -> i64 { return task_set_pfx(TASK_PREFIX, id, status, result) }
calls 1: task_set_pfx
51func task_status(id: *u8, sbuf: *u8) -> i64 { return task_status_pfx(TASK_PREFIX, id, sbuf) }
calls 1: task_status_pfx