tcbrindle / flux

A C++20 library for sequence-orientated programming
https://tristanbrindle.com/flux/
Boost Software License 1.0
472 stars 29 forks source link

Any plans to support "scheduled" operators, like .debounce? #131

Closed mincequi closed 8 months ago

mincequi commented 9 months ago

Hi there and thanks for you effort to create this nice lib. Are there actually any plans to support "scheduled" operator like debounce, throttle, delay? Or maybe smoothing operators like median or exponential moving average?

Thanks already.

Best regards Manuel

tcbrindle commented 9 months ago

Hi @mincequi, I'm afraid I'm not familiar with the "scheduled" operators you mention. Do you have a link to some documentation for another library/language that offers these so I can get an idea of what they do?

mincequi commented 9 months ago

Hi @tcbrindle, I can share some information regarding that. Since I am currently developing in kotlin, there is Kotlin Flow: https://kotlinlang.org/docs/flow.html

And here is the debounce operator for example: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/debounce.html

Hope that helps/gets you an idea, what the fuzz is about :)

Thanks already.

tcbrindle commented 8 months ago

Hi @mincequi, sorry for the delay replying to you!

From reading the documentation then Flux is equivalent to Kotlin's synchronous Sequences rather than its asynchronous, coroutine-based flows. I'd be happy to look at adding equivalents to Kotlin's sequence functions if you think we're missing any, but I think the async "flow" stuff is out of scope for this library I'm afraid.