smol-rs / async-channel

Async multi-producer multi-consumer channel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Synchronous send/recv methods

joshtriplett opened this issue · comments

Sometimes, I need to communicate between a synchronous thread and asynchronous code. I'd like to have synchronous methods for Sender and Receiver.

The flume crate offers both synchronous and asynchronous methods for its channels. (One downside of flume compared to async-channel is that async-channel guarantees in the documentation that the only SendError is "the receiver was closed", and the only RecvError is "the sender was closed". I think that's true for flume as well, but it isn't documented.)

Related: #15