2 unstable releases
| 0.2.0 | Apr 6, 2024 |
|---|---|
| 0.1.0 | Apr 6, 2024 |
#1084 in Concurrency
29 downloads per month
Used in boomnet
5KB
Collection of idle strategies to be used by thread(s) when they have no work to perform.
Examples
use std::time::Duration;
use idle::IdleStrategy;
let idle = IdleStrategy::Sleep(Duration::from_millis(1));
loop {
// application logic
idle.idle(0);
}
Collection of idle strategies to be used by thread(s) when they have no work to perform. Inspired by IdleStrategy from Agrona.
use std::time::Duration;
use idle::IdleStrategy;
let idle = IdleStrategy::Sleep(Duration::from_millis(1));
loop {
// application logic
idle.idle(0);
}