You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may be more of a feature request or simply an implementation issue that I am not following, however is there support for asynchronous pipe reads, for instance can I read every line that comes in from the buffer instead of waiting for the execution of the program to complete.
void rnsd_dameon(quill::Logger *logger)
{
// Start the rnsd subprocess with output piped
Popen popen = RunBuilder({"rnsd"})
.cout(PipeOption::pipe)
.popen();
// Buffer to store the output
char buf[1024];
// Read from the output pipe until there's no more data
size_t bytes_read = 0;
while ((bytes_read = subprocess::pipe_read(popen.cout, buf, sizeof(buf) - 1)) > 0)
{
buf[bytes_read] = '\0'; // Null-terminate the string
LOG_INFO(logger, "RNSD: {}", buf);
std::memset(buf, 0, sizeof(buf)); // Clear the buffer
}
// // Close the process and handle cleanup
// popen.close();
}
For instance rnsd is a subprocess that outputs logging information, however only when I force terminate the program will we see anything output to stdrr. Is this simply a limitation of the library or am I missing something?
The text was updated successfully, but these errors were encountered:
Hello!
This may be more of a feature request or simply an implementation issue that I am not following, however is there support for asynchronous pipe reads, for instance can I read every line that comes in from the buffer instead of waiting for the execution of the program to complete.
For instance rnsd is a subprocess that outputs logging information, however only when I force terminate the program will we see anything output to stdrr. Is this simply a limitation of the library or am I missing something?
The text was updated successfully, but these errors were encountered: