Low-level poller that can wait for read, write, and read/write operations on a file descriptor. It does not provide read/write operations. More...
#include <userver/engine/io/fd_poller.hpp>
Public Types | |
enum class | Kind { kRead = 1 , kWrite = 2 , kReadWrite = 3 } |
Operation kind to wait for. More... | |
Public Member Functions | |
FdPoller (const FdPoller &)=delete | |
FdPoller (FdPoller &&)=delete | |
FdPoller & | operator= (const FdPoller &)=delete |
FdPoller & | operator= (FdPoller &&)=delete |
operator bool () const noexcept | |
The same as IsValid() . | |
bool | IsValid () const noexcept |
Whether the file descriptor is valid. | |
int | GetFd () const |
If IsValid(), get file descriptor. | |
void | Invalidate () |
void | Reset (int fd, Kind kind) |
std::optional< Kind > | Wait (Deadline) |
Low-level poller that can wait for read, write, and read/write operations on a file descriptor. It does not provide read/write operations.
Definition at line 24 of file fd_poller.hpp.
|
strong |
Operation kind to wait for.
Enumerator | |
---|---|
kWrite | < wait for read availability |
kReadWrite | < wait for write availability |
Definition at line 27 of file fd_poller.hpp.
void engine::io::FdPoller::Invalidate | ( | ) |
When you're done with fd, call Invalidate(). It unregisters the fd, after that you have to call close(2) by yourself. After Invalidate() you may not call Wait().
void engine::io::FdPoller::Reset | ( | int | fd, |
Kind | kind | ||
) |