Crates.io | wta-reactor |
lib.rs | wta-reactor |
version | 0.1.0 |
source | src |
created_at | 2022-05-09 08:28:52.604204 |
updated_at | 2022-05-09 08:28:52.604204 |
description | Reactor for the what-the-async runtime |
homepage | |
repository | https://github.com/conradludgate/what-the-async |
max_upload_size | |
id | 583091 |
size | 14,334 |
Reactors react to side effects in the tasks. These side effects could be running timers or listening to OS events.
The timers this reactor currently exposes are simple and naive. It stores all Instant + Waker pairs in a priority queue, the reactor book-keeping will run and attempts to wake any elapsed timers.
For a more complex and faster timer setup, take a look at https://tokio.rs/blog/2018-03-timers
This reactor makes use of mio which was written for use in tokio, but was built into a separate crate. It allows for registering data sources for events, and then polling for those events.
We store use an async-channel per event source registration. Any events that are relevent are pushed to the channel. If an async-read/write future is called, it will retrieve those events from the channel and handle them accordingly.
Currently, the only implemented form of IO is TCP listeners and streams