Apache Mesos
|
Functions | |
Future< short > | poll (int_fd fd, short events) |
Returns the events (a subset of the events specified) that can be performed on the specified file descriptor without blocking. More... | |
Future< size_t > | read (int_fd fd, void *data, size_t size) |
Performs a single non-blocking read by polling on the specified file descriptor until any data can be be read. More... | |
Future< std::string > | read (int_fd fd) |
Performs a series of asynchronous reads, until EOF is reached. More... | |
Future< size_t > | write (int_fd fd, const void *data, size_t size) |
Performs a single non-blocking write by polling on the specified file descriptor until data can be be written. More... | |
Future< Nothing > | write (int_fd fd, const std::string &data) |
Performs a series of asynchronous writes, until all of data has been written. More... | |
Future< Nothing > | redirect (int_fd from, Option< int_fd > to, size_t chunk=4096, const std::vector< lambda::function< void(const std::string &)>> &hooks={}) |
Redirect output from the 'from' file descriptor to the 'to' file descriptor (or /dev/null if 'to' is None). More... | |
Variables | |
const short | READ = 0x01 |
A possible event while polling. More... | |
const short | WRITE = 0x02 |
A possible event while polling. More... | |
const size_t | BUFFERED_READ_SIZE = 16*4096 |
Buffered read chunk size. More... | |
Returns the events (a subset of the events specified) that can be performed on the specified file descriptor without blocking.
Performs a single non-blocking read by polling on the specified file descriptor until any data can be be read.
The future will become ready when some data is read (may be less than the specified size).
Performs a series of asynchronous reads, until EOF is reached.
NOTE: when using this, ensure the sender will close the connection so that EOF can be reached.
Future<Nothing> process::io::redirect | ( | int_fd | from, |
Option< int_fd > | to, | ||
size_t | chunk = 4096 , |
||
const std::vector< lambda::function< void(const std::string &)>> & | hooks = {} |
||
) |
Redirect output from the 'from' file descriptor to the 'to' file descriptor (or /dev/null if 'to' is None).
Optionally call a vector of callback hooks, passing them the data before it is written to 'to'.
The 'to' and 'from' file descriptors will be duplicated so that the file descriptors' lifetimes can be controlled within this function.
Performs a single non-blocking write by polling on the specified file descriptor until data can be be written.
The future will become ready when some data is written (may be less than the specified size of the data).
Performs a series of asynchronous writes, until all of data has been written.
const size_t process::io::BUFFERED_READ_SIZE = 16*4096 |
Buffered read chunk size.
Roughly 16 pages.
const short process::io::READ = 0x01 |
A possible event while polling.
const short process::io::WRITE = 0x02 |
A possible event while polling.