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

From Discord: Add a RateLimiter module #1685

Closed
effect-bot opened this issue Nov 22, 2023 · 4 comments
Closed

From Discord: Add a RateLimiter module #1685

effect-bot opened this issue Nov 22, 2023 · 4 comments

Comments

@effect-bot
Copy link

Summary

In the above conversation, the topic of implementing delayed API calls with Effect was discussed. Several approaches were suggested, including using a queue or a rate limiter. A queue-based implementation was provided, which allows for limiting the number of requests made within a certain time frame. A rate limiter implementation was also mentioned, which can be useful for controlling the rate of API calls.

Some key takeaways from the discussion include:

  1. Using a queue or a rate limiter can help control the rate of API calls and prevent abuse.
  2. The implementation can be done using Effect's queue or by creating a rate limiter service.
  3. A factory pattern can be used to create instances of the rate limiter service, allowing for easier replacement of implementations for testing purposes.
  4. Depending on the requirements, a distributed or shared state may be needed for more advanced rate limiting scenarios.
  5. The possibility of adding a RateLimiting module to the core of Effect was mentioned as a potential future improvement.

Overall, the discussion highlighted different approaches and considerations for implementing delayed API calls and rate limiting with Effect.

Discord thread

https://discord.com/channels/795981131316985866/1138377123799769088

@fubhy fubhy changed the title From Discord: Implementing Delayed API Calls with Effect From Discord: Add a RateLimiter module Nov 22, 2023
@fubhy
Copy link
Member

fubhy commented Jan 5, 2024

@effect-bot
Copy link
Author

effect-bot commented Jan 5, 2024 via email

@hsubra89
Copy link
Contributor

hsubra89 commented Feb 3, 2024

👋🏽 Relatively new to the effect ecosystem.

I followed the conversation on Discord. Even without persistence, I believe having a service specific RateLimiter is generally more useful than not having any solution at all at the moment. If I were to raise a patch based on the Rezilience implementation and the conversation in that thread, would that be accepted?

@fubhy
Copy link
Member

fubhy commented Feb 3, 2024

👋🏽 Relatively new to the effect ecosystem.

I followed the conversation on Discord. Even without persistence, I believe having a service specific RateLimiter is generally more useful than not having any solution at all at the moment. If I were to raise a patch based on the Rezilience implementation and the conversation in that thread, would that be accepted?

Sure, go ahead. Persistence should be considered in the sense that it should be possible to retroactively add it to the implementation but doesn't have to be included in the first iteration as far as I'm concerned.

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

No branches or pull requests

4 participants