1pub mod channel;
2pub mod client;
3pub mod stream;
4pub use channel::*;
5pub use stream::*;
6
7use tokio::time::Duration;
8
9use crate::prelude::*;
10use tokio::sync::mpsc;
11
12pub(crate) const PING_INTERVAL: Duration = Duration::from_secs(25);
16
17#[allow(dead_code)]
20pub(crate) fn send_or_err<T>(
21 sender: &mpsc::UnboundedSender<T>,
22 item: T,
23) -> Result<(), LimitlessError> {
24 sender
25 .send(item)
26 .map_err(|e| LimitlessError::ChannelSendError {
27 underlying: e.to_string(),
28 })
29}