Kotlin / kotlinx.coroutines

Library support for Kotlin coroutines
Apache License 2.0
12.77k stars 1.82k forks source link

Introduce basic Flow<T>.chunked operator #4127

Closed qwwdfsad closed 6 days ago

qwwdfsad commented 3 weeks ago

Fixes #1290

qwwdfsad commented 3 weeks ago

A few things about this PR:

API shape brain dump (eventually I'll move it towards a better-structured issue, but not there yet):

There exists a whole bunch of possibilities, use cases and things full-blown chunked family might/should address

The problem with time is that it requires the actual concurrency, while the size-based version does not. I'm still exploring the possibility of something like chunkedTransform { /* decide whether it's time-based or not */ }, but not much of ideas for now.