| Crates.io | waitx |
| lib.rs | waitx |
| version | 0.1.1 |
| created_at | 2025-07-19 22:49:09.473104+00 |
| updated_at | 2025-07-26 17:34:37.050135+00 |
| description | Lightweight synchronization primitive for one-time ready/wait signaling with optional notification. |
| homepage | |
| repository | https://github.com/eschwart/waitx |
| max_upload_size | |
| id | 1760586 |
| size | 10,808 |
waitx is a minimal synchronization utility for signaling readiness between threads using a lightweight flag, a condition variable, and optional backoff. It provides a flexible alternative to channels or more heavyweight synchronization primitives when you just need to wait for a single "ready" event.
no_std-compatible (with alloc).parking_lot and crossbeam-utils.Add to your Cargo.toml:
[dependencies]
waitx = "0.1"
use std::thread;
use waitx::Waiter;
let waiter = Waiter::default();
let notifier = waiter.notifier();
let handle = thread::spawn(move || {
println!("Worker waiting...");
waiter.wait();
println!("Worker resumed!");
});
std::thread::sleep(std::time::Duration::from_millis(100));
notifier.notify();
handle.join().unwrap();