-
Notifications
You must be signed in to change notification settings - Fork 17
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
added queue manager #192
base: main
Are you sure you want to change the base?
added queue manager #192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great idea! I will look this over more closely and provide some feedback.
TL;DR: I feel like we don't want to couple the I've been trying to think on this PR a bit and I'm not sure how I feel about it. On the one hand, I totally get why this might be implemented in the HTTP client. However, it also feels like this isn't something that I think I would err on the side of the latter, asking developers to determine the best approach for their specific situation and use case if they are encountering Blizzard's rate limits. I also think it would adhere to SOLID principles a little better if the |
I finally got some time to look into this a bit more. According to the Throttling section of the Getting Started documentation...
So the hourly cap allows for an average of 10 requests per second (36,000 / 60 / 60 = 10), and there is an additional per-second cap to limit bursts within that window. So you could theoretically burn through the entire 36,000 requests in the first 6 minutes of the hour at 100 requests per second, and then you'd have "slower service" for the remaining 54 minutes of the hour. There are a few possible approaches to dealing with this in this package:
In addition to the proposed code in this PR, there are some interesting approaches to option 3, such as the token bucket algorithm. There are .NET implementations of this algorithm, like RateLimiters (package at Bert.RateLimiters) and Esendex.TokenBucket. The difference between the burst limit (100 per second) and the hourly limit (36,000 per hour) makes this a bit more nuanced, though. My inclination is to look at option 2. That seems like a simple approach that provides a good value for most consumers, doesn't involve much code, and seems to have a low risk of unintended consequences. Thoughts? |
Wow api can manage only 100 request per second. After this rate most requests would fail.
It is my propose how we can manage it. I created queue manage which should be singleton(per region) and have to be added to all WarcraftClient instances.
This is not finished state. I want to know you opinion about functionality like this before finish it. Maybe you will propose better solution as more advanced programmer/architect.