- Notifications
You must be signed in to change notification settings - Fork0
ebus is a simple Eventbus implementation written in Rust
License
Apache-2.0, MIT licenses found
Licenses found
WeirdPtr/ebus-rs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
ebus is a simple Eventbus implementation written in Rust.
Report Bug ·Request Feature
This is a small Eventbus implementation that can be used to asynchronously transmit data to subscribers of a EventBus instance.
- To build the lib run:
cargo build --release - To run the example run:
cargo run --example basic-implementation
use ebus::{async_subscriber,EventBus,Subscriber};#[derive(Default)]pubstructExampleSubscriber;#[async_subscriber]implSubscriberforExampleSubscriber{typeInput =String;asyncfnon_event_publish(&mutself,event:&Self::Input){println!("Received Data: {:#?}", event);}}#[tokio::main]asyncfnmain(){// Create a new event busletmut event_bus =EventBus::default();// Create a new subscriber and subscribe it to the event buslet subscriber =ExampleSubscriber::default(); event_bus.subscribe(subscriber);// Create an event and queue it for processinglet event_data ="Hello World!".to_owned(); event_bus.queue_and_process(event_data).await;}
See theopen issues for a full list of proposed features (and known issues).
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
- Fork the Project
- Create your Feature Branch (
git checkout -b feat(amazing)/amazing-feature) - Commit your Changes (
git commit -m 'feat(amazing): such progress') - Push to the Branch (
git push origin feat(amazing)/amazing-feature) - Open a Pull Request
Distributed under the MIT or Apache 2 License. SeeLICENSE-MIT orLICENSE-APACHE for more information.
About
ebus is a simple Eventbus implementation written in Rust
Topics
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
