abxbus (Rust)
Idiomatic Rust implementation of abxbus, matching the Python/TypeScript event JSON surface and execution semantics as closely as possible.
Current scope
Implemented core features:
- Base event model and event result model with serde JSON compatibility
- Async event bus with queueing and queue-jump behavior
- Event concurrency:
global-serial,bus-serial,parallel - Handler concurrency:
serial,parallel - Handler completion strategies:
all,first - Event path tracking and pending bus count
- No-arg
now(),wait(),event_result(), andevent_results_list()accessors with options variants for timeout/first-result/result filtering destroy()/destroy_with_options(...)lifecycle cleanup (clear=trueby default)
Not yet implemented in this crate revision:
- Bridges
- Middlewares (hook points are left in code comments)
Quickstart
use ;
use block_on;
use json;
event!
let bus = new;
bus.on;
let event = bus.emit;
block_on;
Use event.now_with_options(EventWaitOptions { first_result: true, ..Default::default() }) when you want to resolve as soon as the first valid result is available while the remaining handlers continue running.
Result helpers default to raise_if_any=true and raise_if_none=false:
use EventResultOptions;
let value = block_on?;
let values = block_on?;
Destroy clears bus-owned state by default:
use DestroyOptions;
bus.destroy;
bus.destroy_with_options;
clear: false still destroys the bus; it only preserves handlers/history for inspection.