-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Output iteration + buffering #33
Comments
👍 But maybe keep them empty strings? The main use-case is not iteration, and it would be annoying having to guard them for each usage when they are almost always filled in. |
Yes, you're right. Also, making the type change from |
I've been trying to implement this but this is more difficult than expected. The problem is being able to first remove the I am trying to think of implementation solutions right now. 🤔 One possible solution is outlined at #43 |
We buffer and return the subprocess stdout/stderr as
result.stdout
andresult.stderr
.Users can also iterate over stdout/stderr. It is helpful for getting progressive output (e.g. a progress bar) or transforming it incrementally.
Also, one of the main use cases of iteration is to reduce memory consumption. However, in our case, the memory is unfortunately not reduced since we buffer
result.stdout
/result.stderr
anyway.The problem is: with the current API, we only know whether the subprocess output will be iterated or not after the subprocess has already started and its output is already buffering. We have to start buffering right away, else we might miss some data.
Some possible solutions:
undefined
forresult.stdout
/result.stderr
.I am leaning towards
1.
because it results in the simplest API, while still keeping the iteration feature. It's somewhat quirky though.What do you think?
The text was updated successfully, but these errors were encountered: