An invocation of a Nodejs async function is automatically tracked within the code as a locally-scoped promise. The runtime will track it, but unless you then register that Promise elsewhere, it can only be accessed within that local scope. You better hope that you immediately chain it with the success callback or capture errors from it.
Spawning a lightweight process in BEAM returns a first-class primitive called a pid. That pid is recorded by the scheduler, so even if it gets lost by the code, you can still find out if it has been taking up resources (when debugging problems live in production).
Supervisor behavior is written in a way so that any gen_server-behavior-complying processes will be linked. That means any crashes of the spawned process will notify the supervisor. That’s not something we are doing with Nodejs async — there is no mailbox to notify, just either awaiting completion, or make sure you add the error handling … which is where people write linters to check.
An invocation of a Nodejs async function is automatically tracked within the code as a locally-scoped promise. The runtime will track it, but unless you then register that Promise elsewhere, it can only be accessed within that local scope. You better hope that you immediately chain it with the success callback or capture errors from it.
Spawning a lightweight process in BEAM returns a first-class primitive called a pid. That pid is recorded by the scheduler, so even if it gets lost by the code, you can still find out if it has been taking up resources (when debugging problems live in production).
Supervisor behavior is written in a way so that any gen_server-behavior-complying processes will be linked. That means any crashes of the spawned process will notify the supervisor. That’s not something we are doing with Nodejs async — there is no mailbox to notify, just either awaiting completion, or make sure you add the error handling … which is where people write linters to check.
Node is single-threaded, so maybe OP means a coroutine, or async functions; Since you can run async functions without awaiting for the result
Wouldn't orphaned async tasks be garbage collected ?