DaanDeMeyer / reproc

A cross-platform (C99/C++11) process library
MIT License
552 stars 65 forks source link

Lifetime with `drain` #96

Closed Curve closed 1 year ago

Curve commented 1 year ago

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?

Curve commented 1 year ago

Solved the issue by using read which seems to be better suited for my use case