jdrouet / tmdb-api

Yet another TMDB api client written in rust, working with async
13 stars 8 forks source link

Fixes and improvements #58

Closed agmbk closed 6 months ago

agmbk commented 7 months ago

Details in the commits messages, I hope the rebase worked as expected, tell me if there's some problems.

jdrouet commented 7 months ago

After thinking about it, I don't think the rate limiting feature belongs in that library. It should be a dumb library that just answers what's expected. The rate limiting should probably be on another layer.

agmbk commented 7 months ago

I tried to find a light rate limit library but I didn't find any very straightforward. The thing is, if one build an iterator fetching the information of a thousand of movies for example everything will fail because of the tmdb rate limit. So the rate limit is pretty essential to garantee a functioning API. The second problem is the impossibility to inject a custom execute method providing no external before_request callback. If one want to implements the rate limit on it's own it should wrap every single calls to the api to pass in it's custom method, which is as painful as rewrtting the api. If you have a better idea on exactly how this layer should be implemented I will probably code it, maybe an before_request callback would do the trick