code wiki / _hdl_build / nx_gen_worker.nx
nx_gen_worker.nx
buildroot/runtime/_hdl_build/nx_gen_worker.nx
about
nx_gen_worker.nx -- the GenWorker object: the GPU-worker CLIENT. Owns dispatch to a worker (a.b.c.d:port) for
image gen (/v1/images/generations) and chat (/v1/chat/completions), plus the non-blocking TCP health-check that
makes multi-worker availability-based selection + failover safe (a powered-off worker must never hang a dispatch).
Extracted from nx_gen_orchestrator (monolith -> objects); behaviour-preserving. THIS is where ER-8 model-select-by-
intent will land (route SFW->controlled model, explicit->turbo). Self-contained (private gw_* helpers). Object
model: companion_arch.md. license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_gen_orchestrator.nx
structs
| none |
consts
| none |
functions
| 9 | func gw_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o } |
| 10 | func gw_catb(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var o: i64=off; var i: i64=0; while i<n {dst[o]=src[i]; o=o+1; i=i+1} return o } |
| 11 | func gw_itoa(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var o: i64=off; var q: i64=k-1; while q>=0{dst[o]=t[q];o=o+1;q=q-1} return o } |
| 14 | func go_worker_dispatch(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, body: *u8, blen: i64, respbuf: *u8, respcap: i64) -> i64 called by 2: go_handle_generatego_handle_chat calls 10: sys_socketsys_set_socket_timeoutsys_mmapsys_connectsys_closegw_cat+4 |
| 41 | func go_worker_img2img(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, body: *u8, blen: i64, respbuf: *u8, respcap: i64) -> i64 called by 1: go_handle_img2img calls 9: sys_socketsys_set_socket_timeoutsys_mmapsys_connectsys_closegw_cat+3 |
| 67 | func go_worker_up(ha: i64, hb: i64, hc: i64, hd: i64, port: i64) -> i64 |
| 95 | func go_chat_dispatch(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, body: *u8, blen: i64, respbuf: *u8, respcap: i64) -> i64 called by 2: go_handle_chatgo_handle_write calls 10: sys_socketsys_set_socket_timeoutsys_mmapsys_connectsys_closegw_cat+4 |