Sergey Chikin

Results 3 comments of Sergey Chikin

I use this: ``` fun Flow.chunked(batchSize: Int): Flow = flow { val accumulator = ArrayList() var counter = 0 [email protected] { accumulator.add(it) if (++counter == batchSize) { emit(accumulator) accumulator.clear() counter...

@pacher Got it, just I think people Googling about simple batching using Kotlin Flows (like this https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#buffer-int-) end up in this thread

Bump on this issue. I use a web interface on top of that so it'd be nice if it was possible to preempt based on an arbitrary job label. Fairness...