hyperlane-broadcast
hyperlane-broadcast is a lightweight and ergonomic wrapper over Tokio’s broadcast channel designed for easy-to-use publish-subscribe messaging in async Rust applications. It simplifies the native Tokio broadcast API by providing a straightforward interface for broadcasting messages to multiple subscribers with minimal boilerplate.
Installation
To use this crate, you can run cmd:
cargo add hyperlane-broadcast
Use
use *;
let broadcast: = new;
let mut rec1: = broadcast.subscribe;
let mut rec2: = broadcast.subscribe;
broadcast.send.unwrap;
assert_eq!;
assert_eq!;
let broadcast_map: = new;
broadcast_map.insert;
let mut rec1: = broadcast_map.subscribe.unwrap;
let mut rec2: = broadcast_map.subscribe.unwrap;
let mut rec3: =
broadcast_map.subscribe_or_insert;
broadcast_map.send.unwrap;
broadcast_map.send.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Contact
For any inquiries, please reach out to the author at root@ltpp.vip.