I have a rendezvous channel with one Receiver and multiple senders, each sender sitting in its own task. I'd like these tasks to wake up when the Receiver gets dropped. For this to work, the task needs to suspend on SendSink::poll_ready.
I don't think this is correct. Instead of always returning Poll::Ready, I think the future needs to check, whether there would be capacity to send an item and if there isn't like in the case of a rendezvous channel, register a waker and return Poll::Pending.
I have a rendezvous channel with one
Receiver
and multiple senders, each sender sitting in its own task. I'd like these tasks to wake up when theReceiver
gets dropped. For this to work, the task needs to suspend onSendSink::poll_ready
.Today, this does not work because
SendFut
returnsPoll::Ready
if it does not have anything to do: https://github.com/zesterer/flume/blob/fcf384956a7badd003c4eca43da5174f4e0c86a0/src/async.rs#L195-L198I don't think this is correct. Instead of always returning
Poll::Ready
, I think the future needs to check, whether there would be capacity to send an item and if there isn't like in the case of a rendezvous channel, register a waker and returnPoll::Pending
.