Comments (7)
Should TMDbLib get an extra Retry-option for all methods, which will make it handle a "RateLimitException", by waiting the specified amount (+200ms for good measure) and then trying again?
Or should we simply throw a RateLimitException, and let the caller handle it?
Since we already use a Client object that people do their requests from, it'd be possible to expose the remaining limits (as described in the Talk page above), through some properties. Basically extend the TMDbRestClient.Execte() method to capture the response headers, and set properties accordingly. The TMDbClient object can then further expose the same thing through proxy-like properties.
from tmdblib.
I see 2 real usage scenario's for the library in this context:
- Using it in a front-end application with 'live' user interaction
- Using it as a service to scrape data automaticly
For scenario 1 it would be best to just throw an error so the user can be informed and for scenario 2 I would prefer a setting on the client object just maximizing my throughput for me without having to care with a property each call.
Exposing the response properties is a good idea, not that much effort and just gives the user something extra to play with if he really needs it.
Don't have the time to do any dev on it atm but at least we will have it worked out here when someone does have time :)
from tmdblib.
So basically, both things. I'm wondering if the rate limit should be an option on the class.. Like:
Client.HandleRateLimiting = true;
In which the methods will halt for X seconds if needed.
from tmdblib.
Yea that's what I would shoot for
from tmdblib.
The feature is now live.
https://www.themoviedb.org/talk/5317af69c3a3685c4a0003b1?page=1
from tmdblib.
from tmdblib.
Added test 6b47d82
from tmdblib.
Related Issues (20)
- Test API key HOT 4
- Error converting value {null} to type 'System.Double'. Path 'popularity'
- Person NullReferenceException for TaggedImage
- DiscoverMovie missing 'with_release_type' parameter HOT 1
- The SSL connection could not be established HOT 1
- GetTrendingMoviesAsync() calling a non-working URL HOT 9
- Updated TranslationData model in Nuget Package HOT 1
- MediaType error
- DiscoverMoviesAsync().IncludeWithAnyProviders() missing :'(
- Deserialization fails for Popular Persons data
- Add V4..
- Support native names in countries
- Security Vulnerability in Newtonsoft.Json 9.0.1 HOT 3
- RobiniaDocs API Explorer
- Update official Nuget with latest dependencies
- DiscoverTv.cs > WhereGenresExclude calls WhereGenresInclude
- some rudimentary tooling to deal with provider ids HOT 1
- Add optional language parameter to GetTvShowVideosAsync
- SearchMultiAsync() throws exception when media type of result is collection
- [Question] Why isn't GetImageUrl static
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmdblib.