#include <userver/engine/io/poller.hpp>
I/O event monitor.
Definition at line 22 of file poller.hpp.
Classes | |
| struct | Event |
| I/O event. More... | |
Public Types | |
| enum class | Status { kSuccess , kInterrupt , kNoEvents } |
| Event retrieval status. More... | |
Public Member Functions | |
| Poller (const Poller &)=delete | |
| Poller (Poller &&)=delete | |
| void | Add (int fd, utils::Flags< Event::Type > events) |
| void | Remove (int fd) |
| Status | NextEvent (Event &, Deadline) |
| Waits for the next event and stores it at the provided structure. | |
| Status | NextEventNoblock (Event &) |
| Outputs the next event if immediately available. | |
| void | Interrupt () |
| Emits an event for an invalid fd with empty event types set. | |
| void | Reset () |
| Clears all the watched events and file descriptors. | |
|
nodiscardstrong |
Event retrieval status.
| Enumerator | |
|---|---|
| kSuccess | Received an event. |
| kInterrupt | Received an interrupt request. |
| kNoEvents | No new events available or task has been cancelled. |
Definition at line 43 of file poller.hpp.
| void engine::io::Poller::Add | ( | int | fd, |
| utils::Flags< Event::Type > | events ) |
Updates a set of events to be monitored for the file descriptor.
At most one set of events is reported for every Add invocation.
| void engine::io::Poller::Remove | ( | int | fd | ) |
Disables event monitoring on a specific file descriptor.
This function must be called before closing the socket.