-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to run subprocess in the background? #9300
Comments
Detached subprocesses are tracked in #5501. But I think you just don't want to pipe the streams: const process = Deno.run({ cmd });
await process.status(); |
Oh so it's not implemented yet. Thanks for info! And thank you for the suggestion about not piping streams. It's actually a good enough solution for now :) Thanks! |
This should have also worked. Could you share the code that you used? Otherwise, you can close this issue if everything works. |
It was something like that: const process = Deno.run({ cmd, stderr: "piped", stdout: "piped" });
for await (const buffer of Deno.iter(process.stdout)) {
const str = new TextDecoder().decode(buffer);
console.log(str);
}
process.close(); It would probably work if I didn't pipe. Closing this issue. Thanks again! |
Hey, I've look for the similar problem in stackoverflow and here in the repository but I haven't found anything. I hope it's not a duplicate.
I'm running subprocess command using code like this:
The command that I'm running is "persistent"/"not exiting" and it doesn't close but just waits for the connections and then it displays some data to the output. However, Deno expects subprocess to close and then display some data. I've also tried iterating over
stdout
withDeno.iter
but the same effect - nothing is logged to the console.How can I run "persistent"/"not exiting" subprocess and still be able to get output whenever something is written to stdout?
The text was updated successfully, but these errors were encountered: