Expand description
Reactor: a per-task registry of fds waiting for IO.
Leaf futures that wrap an OSAL selectable handle (UDP sockets,
TCP sockets, files opened O_NONBLOCK) call
register_read when they return Poll::Pending. The
runtime then blocks the task in OS_SelectMultiple until any
registered fd becomes readable or a timeout elapses.
The reactor is installed into the Waker passed to polls by
crate::runtime::Runtime. Leaf futures find it by reading
the waker’s data pointer.
Structs§
- Reactor
- Per-task reactor state.
Functions§
- register_
read - Registers a read interest for
idusing the reactor carried inwaker. No-op if the waker was not produced by a reactor-backed runtime. - register_
write - Registers a write interest for
idusing the reactor carried inwaker. No-op if the waker was not produced by a reactor-backed runtime.