Run a detached child process in Deno
I'm looking at running a detached child process using Deno. Specifically I want run something like a script or a web server without needing the parent Deno command staying open.
In node I can achieve it using
In Deno the equivalent would be something like this In Deno though as soon as
spawn
doing something like this.
When the parent node command terminates, the child process will continue running.In Deno the equivalent would be something like this In Deno though as soon as
unref
is called, the parent deno command terminates which then kills the child process. Is there a way using Deno to achieve the equivalent behaviour I can achieve in node?1 Reply
I believe this is the following feature request:
https://github.com/denoland/deno/issues/5501
GitHub
Detached processes in deno · Issue #5501 · denoland/deno
Currently node has the capability to run a child process in detached mode (setsid()), which is lacking in deno (?) It seems the Tokio Command doesn't expose any specific functionality for this....