idle

Crates.ioidle
lib.rsidle
version0.2.0
sourcesrc
created_at2024-04-06 17:45:36.34943
updated_at2024-04-06 18:05:39.843033
descriptionCollection of idle strategies to be used by thread(s) when they have no work to perform.
homepage
repositoryhttps://github.com/HaveFunTrading/idle
max_upload_size
id1198446
size6,298
Tom Brzozowski (HaveFunTrading)

documentation

https://docs.rs/idle

README

Build Status Crates.io Documentation License: MIT

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);
}
Commit count: 5

cargo fmt