Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add buffer(duration) function #2240

Closed
helmbold opened this issue Sep 10, 2020 · 2 comments
Closed

add buffer(duration) function #2240

helmbold opened this issue Sep 10, 2020 · 2 comments

Comments

@helmbold
Copy link

helmbold commented Sep 10, 2020

To make Kotlin Flow more suitable for a wide range of tasks, I suggest to add an buffer(Duration) function like in Reactor.

Description

Collect incoming values into multiple List buffers that will be emitted by the returned Flow every bufferingTimespan.

Signature

fun <T> Flux<T>.buffer(bufferingTimespan: Duration): Flow<List<T>>

Consider to also implement:

Flux<List<T>> buffer(Duration bufferingTimespan, Duration openBufferEvery)
@elizarov
Copy link
Contributor

It looks like a duplicate of #1302. Please, take a look.

@helmbold
Copy link
Author

@elizarov Yes, it is a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants