softwaremill / ox

Safe direct style concurrency and resiliency for Scala on the JVM
https://ox.softwaremill.com
Apache License 2.0
311 stars 22 forks source link

Rate control primitives? #120

Open windymelt opened 1 month ago

windymelt commented 1 month ago

Hi! At first, thank you for great async library! I tried examples and played exercises using documentation. It was full of fun!

My suggestion is providing rate control primitives (e.g. simple rate limit, smart (leaky bucket / token bucket) algorithm).

Sometimes I want rate control in production concurrent programming (e.g. batch processing along HTTP API).

Of course, we can implement simple control using par() and Source.tick(). But in production use, I think out-of-the-box rate control primitives is preferred.

adamw commented 1 month ago

Thanks! Definitely, rate control is something that will be great to include, and very much in-line with the scope of the project, in the "resiliency" part.