IOEVENT
A lightweight Rust crate for building event-driven applications on top of Tokio's async I/O streams with low overhead. Facilitates decoupled architectures, suitable for inter-process communication or modular designs.
Features
- Event-driven Architecture: Transforms async I/O operations into unified event streams
- Tokio Integration: Built upon and integrates seamlessly with Tokio's async runtime
- Extensibility: Supports custom event types and dynamic handler registration
- Bi-directional Communication: Enables event emission and response handling through Procedure Calls
Quick Examples
See full working examples in the examples directory.
Define Events
// Custom event tag
;
Create Subscribers
async
static SUBSCRIBERS: & = &;
Build and Run
// Build the event bus
let subscribers = init;
let mut builder = new;
builder.add_pair;
let = builder.build;
// Run the bus
let state = new;
bus.run.await;
Procedure Call (RPC)
See the complete RPC example in examples/rpc.
Define Procedures
// Custom the path
;
;
Handle Procedures
async
Make Calls
let response = state.call.await?;
// ^ CallPrintResponse
License
This project is licensed under the Unlicense - see the LICENSE file for details.