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
pub type MessageSender<T> = crate::tokio::sync::mpsc::Sender<T>;
pub type MessageReceiver<T> = crate::tokio::sync::mpsc::Receiver<T>;
pub fn message_channel<T>() -> (MessageSender<T>, MessageReceiver<T>) {
crate::tokio::sync::mpsc::channel(16)
}
pub type RouterSender<T> = crate::tokio::sync::mpsc::Sender<T>;
pub type RouterReceiver<T> = crate::tokio::sync::mpsc::Receiver<T>;
pub fn router_channel<T>() -> (RouterSender<T>, RouterReceiver<T>) {
crate::tokio::sync::mpsc::channel(64)
}
pub type SmallSender<T> = crate::tokio::sync::mpsc::Sender<T>;
pub type SmallReceiver<T> = crate::tokio::sync::mpsc::Receiver<T>;
pub fn small_channel<T>() -> (SmallSender<T>, SmallReceiver<T>) {
crate::tokio::sync::mpsc::channel(1)
}