-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 limit status race condition #289
Comments
Overall, I'm curious about the decision to store rate limit status globally. Perhaps it's more appropriate as a property of |
Thanks for the detailed bug report. This is a legitimate issue. The decision to have a global There are a few possible solutions:
I'd like to spend a little more time thinking about which of these solutions is best before I begin working on the implementation. Thanks again for the detailed bug report. |
Word. I like the overall idea of what the singleton was trying to accomplish, so option 2 or 3 seem reasonable. Something also to consider is the way Search API rate limiting is handled. Right now, the |
Yeah, I suppose we could have a On second thought, |
The final solution turned out to be a combination of 1 and 2. I'm pretty happy with the implementation. This fix will be included in version 3.3, which could ship as early as tomorrow evening. If you'd like to use it before then, you can specify your gem 'twitter', :git => 'git://github.com/sferik/twitter.git' |
Nice work! |
My application deals with multiple instances of
Twitter::Client
that can run simultaneous requests from different threads, on behalf of different Twitter users. Here's some code to demonstrate:Unless I'm missing something, there doesn't seem to be a way to retrieve the rate limit status from the error object directly like there used to be. That would solve the race condition.
Any thoughts?
P.S. Major thanks to the maintainers for creating such a solid gem!
The text was updated successfully, but these errors were encountered: