Code Monkey home page Code Monkey logo

Comments (7)

LordMike avatar LordMike commented on August 13, 2024

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.

Naliath avatar Naliath commented on August 13, 2024

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.

LordMike avatar LordMike commented on August 13, 2024

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.

Naliath avatar Naliath commented on August 13, 2024

Yea that's what I would shoot for

from tmdblib.

LordMike avatar LordMike commented on August 13, 2024

The feature is now live.

https://www.themoviedb.org/talk/5317af69c3a3685c4a0003b1?page=1

from tmdblib.

Naliath avatar Naliath commented on August 13, 2024

ea8c2e1

from tmdblib.

LordMike avatar LordMike commented on August 13, 2024

Added test 6b47d82

from tmdblib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.