You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice if this library supported a way for http.Client outgoing requests to utilizing limiter.Limit to rate limit based on configured API rate limits useful for things like:
Filter and intercept http.Client requests and map to a limit.Limiter which could then have some policy callback to let the client
block and wait until reset time
abort request and send error back
maybe fake an HTTP rate-limit response (but avoid hitting actual servers)
HTTP API's usually return with headers like X-RateLimit-* it'd be useful if there was a way to call limiter.Limiter.Set(key string, c *Context) to attempt to keep in sync with server state
I think you'd want to be able to configure a limit.Limiter per URL request path e.g.:
/1.1/users/user_timeline.json
Similar to how server-side HTTP handlers are setup:
Seems like there's a good example of intercepting an HTTP request and redirecting the response or also using the real response (e.g. if Rate limit is exceeded).
Overview
It'd be nice if this library supported a way for
http.Client
outgoing requests to utilizinglimiter.Limit
to rate limit based on configured API rate limits useful for things like:Features
http.Client
requests and map to alimit.Limiter
which could then have some policy callback to let the clientX-RateLimit-*
it'd be useful if there was a way to calllimiter.Limiter.Set(key string, c *Context)
to attempt to keep in sync with server stateI think you'd want to be able to configure a
limit.Limiter
per URL request path e.g.:/1.1/users/user_timeline.json
Similar to how server-side HTTP handlers are setup:
Maybe even use
http.NewServeMux
to client-side proxy rate limit responses?There's some example of it here:
The text was updated successfully, but these errors were encountered: