Problem: there is no "event" to indicate that the input event stream has closed. So a naive "proxy' pattern like:
let (tx, rx) = channel();
Builder::new()
.on_receive_dispatch(... /* send incoming event to proxy */ ...)
.connect_with(async |cx| {
/* receive outgoing event to proxy */
while let Some(m) = rx.recv().await { cx.send(msg); }
})
.await;
will hang forever, because the loop in connect_with never completes. I often create loops like this where the tx endpoint is given to some central dispatcher.
I'm debating the best fix here and I'm not entirely sure.
Problem: there is no "event" to indicate that the input event stream has closed. So a naive "proxy' pattern like:
will hang forever, because the loop in
connect_withnever completes. I often create loops like this where thetxendpoint is given to some central dispatcher.I'm debating the best fix here and I'm not entirely sure.