Description
In attempting to use the futures::sink::Sink
implementation for postage::dispatch::Sender
, it became pretty evident that the implementation around Sink::start_send
is broken. Specifically, if the underlying queue is full -- since the poll_ready
implementation doesn't reserve a send slot -- it returns an error, but swallows the item that was handed over.
Effectively, this makes it unusable for the given Sink
implementation. The push
method on the queue hands back the item if there's an error, so it seems like SendError
should become an enum to differentiate between a closed channel and a rejected send.
(I also realize that the Sink
trait itself is fraught with peril and will likely go the way of the dodo given the issues with the path to std
stabilization, but nonetheless...)