Open NathanSWard opened 1 year ago
Yes, this is definitely missing functionality. I think this would be relatively easy to implement: internally we could just use a regular old async timeout (tokio or otherwise) and then use self.hook.take()
to pull the value out of the future. Would you be interested in implementing this?
Sure, I'll take a stab at the implementation and post a PR for it.
See here for the PR :)
Currently
send_timeout/deadline
are implemented via blocking. This means if I want to make anasync
variant of these two, I need to use another library such astokio::time::timeout
- which notably is OK.However, the problem comes in when the timeout happens before the value is successfully sent on the channel. There is no way to retrieve the queued message from the
SendFut
.Ideally
SendFut
would have aninto_inner(self) -> Option<T>
that would returnSome(T)
if the value was not yet send successfully.