Skip to content
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

Add reproc::fill for sending stdin after process starts #102

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

stingray-11
Copy link
Contributor

@stingray-11 stingray-11 commented May 19, 2023

Taking a second attempt at this. See issue #67. My program uses reproc to drain/fill with ~50MB in/out per process.

This time I implemented fill() in nearly the same way as the existing drain(), including a callback template and a default for strings. Also, I implemented the analogous code in the C portion the same as drain(). Also added examples and tested. The drain-fill tests now compare the input/output to actually check both drain/fill are working properly.

Also included are a couple minor fixes - use SYSTEM in cmake so reproc warnings don't show up in users of the library, and add the ability to specify a custom buffer size for fill/drain (64K rather than 4K reduces my program's CPU usage by ~20%).

@stingray-11
Copy link
Contributor Author

Some tests are failing but not because of these changes... macOS is missing clang-tidy and windows doesn't like a #define in reproc.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant