does kotlin flow currently support creating batche...
# coroutines
p
does kotlin flow currently support creating batches of items, e.g. for executing batched sql inserts? like that (pseudo code): flow.batch(size=20).collect { batchOfUpTo20ItemsFromFlow -> /* do something */ }
g
Nopt, there is no Flow version of chunked/windowed operator in Flow, there is a discussion about it: https://github.com/Kotlin/kotlinx.coroutines/issues/1290
also there is a PR, but it will not be merged, there are plans for more (with support of time-based batches): https://github.com/Kotlin/kotlinx.coroutines/pull/1558
201 Views