1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// SPDX-License-Identifier: MIT
//! JAEB is an in-process, actor-based event bus for Tokio applications.
//!
//! It supports synchronous and asynchronous listeners, explicit dependency
//! injection via handler structs, unsubscribe handles, retry/dead-letter
//! failure policies, and graceful shutdown.
//!
//! # Requirements
//!
//! An active **Tokio runtime** must be available when constructing an
//! [`EventBus`] (via [`new`](EventBus::new) or
//! [`builder().build()`](EventBusBuilder::build)), because the internal
//! actor task is spawned immediately via [`tokio::spawn`]. Both construction
//! methods return [`Result`] and validate their configuration before spawning.
//!
//! # Important semantics
//!
//! - **Sync handlers** — executed inline on the actor task (with panic
//! isolation via `catch_unwind`) and complete before
//! [`EventBus::publish`](EventBus::publish) returns. Sync handlers
//! execute exactly once — retries are not supported.
//! - **Async handlers** — spawned into a [`JoinSet`](tokio::task::JoinSet);
//! `publish` may return before they finish. Async events require `E: Clone`
//! because the event is cloned for each handler invocation. Retries and
//! delays are supported via [`FailurePolicy`].
//! - **Shutdown** — [`EventBus::shutdown`](EventBus::shutdown) drains
//! queued messages, then waits for (or aborts) in-flight async tasks.
//! Shutdown is idempotent: subsequent calls return `Ok(())`.
//! - **Dead letters** — after all retries are exhausted a
//! [`DeadLetter`] is published unless disabled.
//! A failing dead-letter handler will **not** produce another dead letter
//! (recursion is guarded).
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;