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

Rate control primitives? #120

Open
windymelt opened this issue Apr 12, 2024 · 9 comments · May be fixed by #235
Open

Rate control primitives? #120

windymelt opened this issue Apr 12, 2024 · 9 comments · May be fixed by #235

Comments

@windymelt
Copy link
Contributor

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
Copy link
Member

adamw commented Apr 12, 2024

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.

@adamw
Copy link
Member

adamw commented Oct 16, 2024

Just as Ox has repeat and retry, the goal here is to implement a rate limiter. Similarly to other resilience operation, this should come with a configuration object.

Rate limiting itself should be possible in a stateful way, e.g. given a RateLimiter.apply(=> T): T method, which will block if the rate limit is reached. But we're open to any other suggestions.

As to the rate limiting configuration options, the algorithm mentioned in the original description should be available. Moreover, resilience4j might provide more inspiration.

@adamw
Copy link
Member

adamw commented Oct 16, 2024

/bounty $500

Copy link

algora-pbc bot commented Oct 16, 2024

💎 $500 bounty • SoftwareMill

Steps to solve:

  1. Start working: Comment /attempt #120 with your implementation plan
  2. Submit work: Create a pull request including /claim #120 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to softwaremill/ox!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @paulpdaniels Oct 16, 2024, 3:20:03 PM WIP
🟢 @rathi-dev Oct 17, 2024, 8:43:44 AM WIP
🟢 @vishalpatil1899 Oct 21, 2024, 1:22:21 AM WIP
🟢 @pablf #235

@paulpdaniels
Copy link

paulpdaniels commented Oct 16, 2024

/attempt #120

Algora profile Completed bounties Tech Active attempts Options
@paulpdaniels 3 bounties from 1 project
Scala, JavaScript,
TypeScript & more
Cancel attempt

@rathi-dev
Copy link

rathi-dev commented Oct 17, 2024

/attempt #120

@pablf pablf linked a pull request Oct 19, 2024 that will close this issue
Copy link

algora-pbc bot commented Oct 19, 2024

💡 @pablf submitted a pull request that claims the bounty. You can visit your bounty board to reward.

@vishalpatil1899
Copy link

vishalpatil1899 commented Oct 21, 2024

/attempt #120

@adamw
Copy link
Member

adamw commented Oct 21, 2024

As we are getting first PRs for the bounties, I've published our "How to prepare a good PR" guide. I should have probably done this right away, sorry! :)

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

Successfully merging a pull request may close this issue.

5 participants