Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

matthew-engi/ewait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ewait - Asynchronous Event System

A thread-safe, asynchronous event system for Rust.

Ewait allows the creation of events that can trigger multiple callbacks parallely, making it easier to build event-based code.


Features

  • Every connected callback runs in its own Tokio task, allowing parallel execution.
  • Provides easy methods to connect, disconnect, and fire events.
  • Conveniently provides a JoinHandle<R> to .await results to if the results are of interest.
  • Automatically manages the distribution of Arc references between threads.

Installation

Simply run cargo add ewait in the desired Rust project. Here is an example on how to use the Event struct:

use tokio;
use ewait::Event;
use std::sync::Arc;

async fn hello(_: Arc<()>) {
    println!("Hello World!")
}

#[tokio::main]
async fn main() {
    let mut event1: Event<()> = Event::new();
    event1.connect(hello);
    event1.fire(());
}

Warning

This library requires a Tokio runtime to function. Make sure your main function uses #[tokio::main].

Caution

This project is developed by a new Rustacean. The testing is limited.

About

A thread-safe, asynchronous event system for Rust.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages