asyncnal

Crates.ioasyncnal
lib.rsasyncnal
version0.3.1
created_at2025-08-05 01:28:58.0211+00
updated_at2025-09-04 18:26:48.544772+00
descriptionFast concurrent & local asyncronous signalling
homepage
repositoryhttps://github.com/DiscordJim/asyncnal
max_upload_size
id1781357
size95,683
Homer Riva-Cambrin (DiscordJim)

documentation

README

asycnal

Fast, executor-agnostic, asynchronous signalling primitives for multithreaded and singlethreaded runtimes

TODO: Deal wwith the waker swap

GitHub Actions Status · Crates.io Version · Crates.io Downloads · License: MIT

Features

  • Minimal unsafe code.
  • Extremely fast under high-contention, built on efficient lock-free queueing.
  • Executor agnostic.
  • Supports thread-per-core (TPC) and local runtimes.

Quickstart

You can get started with the following code:

use asyncnal::{Event, EventSetter};

let event = Event::new();
assert!(!event.has_waiters());

// We'll pre-set the event.
event.set_one();
 
// This will immediately return.
event.wait().await;

For more information, please read the documentation which contains an extensive set of examples on how this crate can be used along with the variants contained within the crate.

Testing

First, there are quite a few feature options on this crate, so if you are making any changes I would highly recommend

$ cargo install cargo-all-features
$ cargo check-all-features

Normal tests can be run as follows:

$ cargo test
Commit count: 18

cargo fmt