In the background example drain is used to read the process' output into a string.
Is there some way to tell drain to stop? In case I need to destroy the string before the process exits.
Currently I'm spawning a process that should run for a while in the background, and my code is in a loop that I want to break out of as soon as the child process prints something to stdout - Is there some way to do that?
In the background example
drain
is used to read the process' output into a string.Is there some way to tell
drain
to stop? In case I need to destroy the string before the process exits.Currently I'm spawning a process that should run for a while in the background, and my code is in a loop that I want to break out of as soon as the child process prints something to stdout - Is there some way to do that?