Skip to main content

exit_if_worker

Function exit_if_worker 

Source
pub fn exit_if_worker(code: i32)
Expand description

process.exit(code) on a worker thread ends the WORKER, not the process (node’s process.exit in a worker stops its isolate): the Worker’s 'exit' fires on the spawning thread with code, and nothing after the call runs on this one. A thread cannot be stopped from inside its own JS stack, so it is parked for good once the event is posted. Returns on the main thread.