A reactor is the Tokio runtime component that listens for operating-system I/O events and communicates readiness to the rest of the runtime. It connects kernel mechanisms such as epoll with futures, Wakers, and the executor. section 10.4
A file-reading task follows this path:
- The kernel handles the file operation while the runtime schedules another asynchronous task. section 10.4
- When the operation completes, the reactor recognizes the resulting operating-system event and marks the task's data as ready. section 10.4
- The task's Waker informs the executor, which schedules the task and calls its future's poll function. section 10.4
Use the Tokio component diagram to trace relationships among the reactor, executor, Waker, futures, kernel, and asynchronous tasks. section 10.4
