agent_block_core/bus/mod.rs
1//! EventBus: serial event dispatcher feeding Lua handlers registered via
2//! `bus.on(kind, fn)` / `bus.on_any(fn)`.
3//!
4//! This subtask (Subtask 1) defines the pure-Rust core: [`Event`],
5//! [`Source`], [`EventBus`], plus a [`Handler`] trait placeholder that
6//! Subtask 3 will swap for an `mlua::RegistryKey`-backed implementation.
7//!
8//! Module wiring (`mod bus;` in `main.rs`) and `tokio-util` Cargo
9//! dependency are deferred to Subtask 2.
10
11pub mod dispatcher;
12pub mod event;
13pub mod source;
14
15// Consumed by `bridge::bus` (Lua bridge) and `host::BusRelayHandler`
16// (mesh → bus adapter). `HandlerKey` / `Source` are not yet referenced
17// outside `bus::dispatcher` / `bus::source` — kept public for forthcoming
18// adapters (webhook, WSS, timer).
19#[allow(unused_imports)]
20pub use dispatcher::HandlerKey;
21pub use dispatcher::{EventBus, Handler};
22#[allow(unused_imports)]
23pub use event::{AckReceiver, AckSender};
24pub use event::{AckResult, Event};
25#[allow(unused_imports)]
26pub use source::Source;