| Crates.io | events_once |
| lib.rs | events_once |
| version | 0.5.14 |
| created_at | 2025-11-08 14:37:27.999871+00 |
| updated_at | 2026-01-07 06:37:23.053192+00 |
| description | Efficient oneshot events (channels) with support for single-threaded events, object embedding, event pools and event lakes |
| homepage | |
| repository | https://github.com/folo-rs/folo |
| max_upload_size | |
| id | 1922925 |
| size | 377,833 |
Efficient oneshot events (channels) with support for single-threaded events, object embedding, event pools and event lakes.
An event is a pair of a sender and receiver, where the sender can be used at most once. When the event occurs, the sender submits a payload to the receiver. Meanwhile, the receiver can await the arrival of the payload.
This package expands on basic oneshot functionality and provides additional features while maintaining high performance and low overhead:
The events support both asynchronous awaiting and ad-hoc completion polling. Synchronous waiting for event completion is not supported.
use events_once::Event;
#[tokio::main]
async fn main() {
let (sender, receiver) = Event::<String>::boxed();
sender.send("Hello, world!".to_string());
// Events are thread-safe by default and their endpoints
// may be freely moved to other threads or tasks.
tokio::spawn(async move {
let message = receiver.await.unwrap();
println!("{message}");
})
.await
.unwrap();
}
More details in the package documentation.
This is part of the Folo project that provides mechanisms for high-performance hardware-aware programming in Rust.