You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let msg = select!{
tx.disconnected() => returnErr("disconnected");
result = read_some_stream() => result?,};let msg = process(msg);if tx.send_async(msg).await.is_err(){returnErr("disconnected");}
I.e. I want to asynchronously read from some source, and pass the result to a channel. If the channel gets disconnected in the meantime, I want to know that immediately, not only when I send a message.
Would it be possible to add such a feature? I did try to read the code and to implement it myself, but I failed miserably.
The text was updated successfully, but these errors were encountered:
I think implementing a disconnect signal would probably take some time. Is it not feasible to have the thread/task on the other end of the channel to send some sort of shutdown signal?
I want to do something similar to this:
I.e. I want to asynchronously read from some source, and pass the result to a channel. If the channel gets disconnected in the meantime, I want to know that immediately, not only when I send a message.
Would it be possible to add such a feature? I did try to read the code and to implement it myself, but I failed miserably.
The text was updated successfully, but these errors were encountered: