```channelFlow { ... }.conflate().buffer(3, onBuff...
# coroutines
k
Copy code
channelFlow { ... }.conflate().buffer(3, onBufferOverflow = Suspend)
will configure the underlying channel to have a size of three with an overflow strategy of
DROP_OLDEST
. The documentation mentions the following:
Conflation takes precedence over buffer() calls with any other capacity.
Is it a bug that my configured channel has a size of three, or does the above piece of documentation only apply to the buffer overflow strategy?
image.png
When debugging the fusing of:
Copy code
channelFlow { ... }.conflate().buffer(3, onBufferOverflow = Suspend)
I’m seeing the following values in the debugger. This seems really unintuitive based on the documentation and therefore I think this might be a bug.
d
Yep, the documentation is at least misleading.
k
Can I take this opportunity to advocate that conflation should always supersede buffering? My use case is that I am writing library code which expects that the underlying channel is always conflated. If
conflate
can't make that guarantee, then I'll have to fall back to the regular
flow
builder with a manually configured channel.
Should I file a github issue for this?
d
Sure.