Optionaloptions: ExecutorOptionsReadonlypendingCalls queued or running.
ReadonlycompletedCalls settled since the executor was created.
ReadonlyrunningWhether the thread is running (started by the first call, stopped by close()).
ReadonlyclosedWhether close() has been called.
A native thread owned by node-ctypes, with a FIFO queue of calls.
fn.callOn(executor, ...args)isfn.callAsync(...args)(same conversions, out parameters, errcheck and argument lifetime) run on this thread instead of a libuv worker: calls run one at a time, in arrival order, so a slow call never occupies the libuv pool (fs, dns, crypto) and calls that must share a thread (thread-local state, thread-affine handles) can.The thread starts with the first call. While calls are pending the process stays alive; an idle executor does not keep it alive and is collected with its thread when unreferenced. When the process exits (or a worker thread terminates) queued calls are discarded and the teardown waits for the running call to return (
worker.terminate()resolves after it).A call that completes within the ExecutorOptions.spin budget is completed before
callOnreturns: its errcheck runs then, and the promise is already settled (awaitstill resumes asynchronously).No Python equivalent.
Example