Skip to content

Draft: new features in SometimesUnboundedSink for padding

We need the ability to implement on-demand blocking on these sinks. (That is, a pair of set_blocked and set_unblocked methods.)

While a SometimesUnboundedSink is blocked, it acts as if it's full, regardless of the state of the underlying sink. (You can still use its "unbounded_send" methods.)

Additionally, when a SometimesUnboundedSink is blocked, it has an upper bound of the number of messages it is willing to flush onto the underlying sink, even if the underlying sink has room.


@Diziet Thanks for looking at this! I fully expect that there are dreadful mistakes here; I'm hoping that you can tell me what they are and how to solve them. Especially see XXXXs; I will need to figure out what the new invariants are and how to talk about them.

Also, there's a TODO at the start of the structure about an additional enhancement we might need, depending on what we decide about queueing on the discussion of !3225. If you can offer any guidance there, that would be awesome.

I considered doing this in another type instead of SometimesUnboundedSink, but it turns out that SUS only has one current user, so there's no point (for now) in having two separate types.

cc @gabi-250 @mikeperry @pulls

Merge request reports

Loading