![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
Abstract interface for FD-based event polling. More...
#include <dfx-fdwatch/Poller.hpp>
Public Member Functions | |
| virtual | ~Poller ()=default |
| Virtual destructor for interface. | |
| virtual void | registerFd (BorrowedFd fd, EventInterests events, FdCallback cb)=0 |
| Registers a file descriptor with the poller. | |
| virtual void | deregisterFd (BorrowedFd fd) noexcept=0 |
| Deregisters a file descriptor from the poller. | |
| virtual void | deferCall (Callback cb)=0 |
| Defer the call to the callback to the next time the event loop is reached. | |
Abstract interface for FD-based event polling.
Poller is responsible for monitoring file descriptors and invoking user-provided callbacks when the requested events occur.
The interface does not own file descriptors: ownership remains with the caller (typically via OwnedFd or PollerFd).
Concrete implementations may be based on platform-specific mechanisms such as epoll, poll, or kqueue.
Thread-safety guarantees are implementation-defined; unless explicitly documented otherwise, all operations are expected to be performed from the same thread.
|
virtualdefault |
Virtual destructor for interface.
|
pure virtual |
Defer the call to the callback to the next time the event loop is reached.
The callback will be invoked as soon as all currently pending event in the event loop have been processed.
| cb | Callback to be invoked later. |
Implemented in dfx::FdWatch::EPollPoller, and dfx::Runtime::Api::PollerProxy.
|
pure virtualnoexcept |
Deregisters a file descriptor from the poller.
After this call, the poller will no longer monitor the FD and no callbacks will be triggered for it.
| fd | Borrowed file descriptor to remove. |
Implemented in dfx::FdWatch::EPollPoller, and dfx::Runtime::Api::PollerProxy.
|
pure virtual |
Registers a file descriptor with the poller.
Once registered, the poller will monitor fd for the specified events and invoke cb when they occur.
| fd | Borrowed file descriptor to monitor. |
| events | Events of interest. |
| cb | Callback invoked when events occur. |
fd must refer to a valid, open file descriptor. Implemented in dfx::FdWatch::EPollPoller.