#include <muxable-pipe.hh>
Public Types | |
using | CommChannel |
Public Member Functions | |
void | poll (std::optional< unsigned int > timeout) |
void | iterate (std::set< CommChannel > &channels, std::function< void(Descriptor fd, std::string_view data)> handleRead, std::function< void(Descriptor fd)> handleEOF) |
Public Attributes | |
std::vector< struct pollfd > | pollStatus |
std::map< int, size_t > | fdToPollStatus |
Use pool() (Unix) / I/O Completion Ports (Windows) to wait for the input side of any logger pipe to become ‘available’. Note that ‘available’ (i.e., non-blocking) includes EOF.
using nix::MuxablePipePollState::CommChannel |
void nix::MuxablePipePollState::iterate | ( | std::set< CommChannel > & | channels, |
std::function< void(Descriptor fd, std::string_view data)> | handleRead, | ||
std::function< void(Descriptor fd)> | handleEOF ) |
Process for ready (Unix) / completed (Windows) operations, calling the callbacks as needed.
handleRead | callback to be passed read data. |
handleEOF | callback for when the MuxablePipe has closed. |
void nix::MuxablePipePollState::poll | ( | std::optional< unsigned int > | timeout | ) |
Check for ready (Unix) / completed (Windows) operations