Files
fivenode_go/capi/napi_delay.prg
CharlesKWON 6a8ada16b2 feat(napi): VM pool + per-request isolation for serial/parallel handling
- fnode capi shim: single VM+mutex -> VM pool (FIVENODE_VM_POOL, default 4;
  1=serial, N=parallel). Each request checks out its own VM so PRG runs
  concurrently across libuv worker threads.
- per-request data keyed by VM (FN_NAPI_REQ via ctx.T.VM()) -- no shared
  capiReq race.
- napibridge: per-VM handle tracking; ReleaseAll(vm) auto-ends only that
  request's npm handles (parallel-safe auto-__end__). FN_AWAIT replaces the
  reserved Five AWAIT keyword (Clipper-compat, no gengo codegen -> NIL).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 08:57:31 +09:00

13 lines
418 B
Plaintext

FUNCTION FN_HANDLE()
LOCAL oD := FN_REQUIRE( "/Users/charleskwon/fivenode/fivenode/fivenode/napi/test/delaymod" )
LOCAL cR
IF ! HB_ISOBJECT( oD )
RETURN hb_jsonEncode( { "err" => FN_LASTERROR() } )
ENDIF
cR := FN_AWAIT( oD:wait( 200 ) )
RETURN hb_jsonEncode( { ;
"status" => 200, ;
"headers" => { "Content-Type" => "application/json" }, ;
"body" => hb_CStr( cR ) ;
} )