Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
I/O Timer

Set of I/O-free Rust coroutines to manage timers, based on io-stream.
This library allows you to manage timers using an I/O-agnostic approach, based on 3 concepts:
Coroutine
A coroutine is an I/O-free, resumable and composable state machine that emits I/O requests. A coroutine is considered terminated when it does not emit I/O requests anymore.
See available coroutines at ./src.
Runtime
A runtime contains all the I/O logic, and is responsible for processing I/O requests emitted by coroutines.
See available runtimes at pimalaya/io-stream.
Loop
The loop is the glue between coroutines and runtimes. It makes the coroutine progress while allowing runtime to process I/O.
Examples
Standard blocking client using TCP
use TcpStream;
use handle;
use ;
let mut stream = connect.unwrap;
// start the timer
let mut arg = None;
let mut start = new;
while let Err = start.resume
// wait few seconds, then get the timer
let mut arg = None;
let mut get = new;
let timer = loop ;
See complete example at ./examples/std-tcp.rs.
Tokio async server using Unix sockets
use ;
use handle;
use ;
let config = TimerConfig ;
let timer = new;
// use an unbounded channel for receiving timer events
let = unbounded_channel;
// start the timer event notifier
spawn;
// define and spawn the timer tick
// this is needed to update the internal state of the timer
spawn;
// listen to the unix socket for client <-> server communication
let listener = bind.unwrap;
let = listener.accept.await.unwrap;
loop
See complete example at ./examples/tokio-unix.rs.
More examples
See projects built at the top of this library:
- comodoro: CLI to manage timers
Sponsoring
Special thanks to the NLnet foundation and the European Commission that helped the project to receive financial support from various programs:
- NGI Assure in 2022
- NGI Zero Entrust in 2023
- NGI Zero Core in 2024 (still ongoing)
If you appreciate the project, feel free to donate using one of the following providers:
