跳到主要内容

unbounded_channel

搜索

函数 unbounded_channel 

源代码
pub fn unbounded_channel<T>() -> (UnboundedSender<T>, UnboundedReceiver<T>)
展开描述

创建一个无界 mpsc channel,用于在异步任务之间通信,没有背压。

只要接收端尚未关闭,此 channel 上的 send 始终会成功。如果接收者落后,消息将被任意缓冲。

注意 that the amount of available system memory is an implicit bound to the channel. Using an unbounded channel has the ability of causing the process to run out of memory. In this case, the process will be aborted.