Skip to content

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

Open
stingray-11 wants to merge 24 commits intodaandemeyer:mainfrom
stingray-11:main
Open

Add reproc::fill for sending stdin after process starts#102
stingray-11 wants to merge 24 commits intodaandemeyer:mainfrom
stingray-11:main

Conversation

@stingray-11
Copy link
Copy Markdown
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
Copy Markdown
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