Join Slack
Is there a rxjava `buffer` equivalent in Flow? flow.buffer is not the same behavior from what I see,...
# coroutines
u
ursus
11/23/2021, 1:44 AM
Is there a rxjava
buffer
equivalent in Flow? flow.buffer is not the same behavior from what I see, i.e. I want to collect upstream emits into some buffer, and only emit the buffer when its full/time elapses etc
r
Richard Gomez
11/23/2021, 1:49 AM
Perhaps windowed or chunked?
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/windowed.html
https://github.com/Kotlin/kotlinx.coroutines/issues/1290
u
ursus
11/23/2021, 1:56 AM
open, so .. no, bummer
ursus
11/23/2021, 2:04 AM
btw any reason for changing the name? I mean reactive streams called this buffer since ever
g
gildor
11/23/2021, 3:53 AM
The reason is to be consistent with existing kotlin operators
gildor
11/23/2021, 3:55 AM
There is a PR with this operator, you can try to use it:
https://github.com/Kotlin/kotlinx.coroutines/pull/1558
30
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by