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
Maybe this is just a misunderstanding of what poll_flush actually means, but from the documentation I would expect poll_flush of the Sink trait to only return Poll::Ready once all buffered messages have been received by the Receiver of the channel, meaning the buffer is empty.
I wanted to create the same issue. Sender should document what it considers flushed in terms of Sink. The current behavior is that it is flushed when there is space to receive more messages. When the the capacity is 0 this is equivalent to the item having been read but it isn't at higher capacity. Since this is undocumented users might confuse the behavior.
Maybe this is just a misunderstanding of what
poll_flush
actually means, but from the documentation I would expectpoll_flush
of theSink
trait to only returnPoll::Ready
once all buffered messages have been received by theReceiver
of the channel, meaning the buffer is empty.futures-rs/futures-sink/src/lib.rs
Lines 93 to 95 in 939614b
Currently the
Sink
implementation forSender
andUnboundedSender
don't do that though, makingpoll_flush
almost equivalent topoll_ready
. See:futures-rs/futures-channel/src/mpsc/sink_impl.rs
Lines 17 to 25 in 939614b
In the Unbounded case, it doesn't flush anything at all:
futures-rs/futures-channel/src/mpsc/sink_impl.rs
Lines 44 to 46 in 939614b
Is this intentional? And if so, how does this relate to the documentation of the
Sink
trait? Maybe the documentation can be updated to clarify this?The text was updated successfully, but these errors were encountered: