Skip to main content

hyperlane_broadcast/
lib.rs

1//! hyperlane-broadcast
2//!
3//! hyperlane-broadcast is a lightweight
4//! and ergonomic wrapper over Tokio’s broadcast channel designed
5//! for easy-to-use publish-subscribe messaging in async Rust applications.
6//! It simplifies the native Tokio broadcast API by providing a straightforward
7//! interface for broadcasting messages to multiple subscribers with minimal boilerplate.
8
9mod broadcast;
10mod broadcast_map;
11
12pub use {broadcast::*, broadcast_map::*};
13
14use std::{fmt::Debug, hash::BuildHasherDefault};
15
16use {
17    dashmap::{mapref::one::Ref, *},
18    tokio::sync::broadcast::{
19        error::SendError,
20        {Receiver, Sender},
21    },
22    twox_hash::XxHash3_64,
23};
24
25#[cfg(test)]
26use std::time::Duration;
27
28#[cfg(test)]
29use tokio::{
30    sync::broadcast::error::RecvError,
31    time::{error::Elapsed, timeout},
32};