Skip Menu |

This queue is for tickets about the REST-Client CPAN distribution.

Report information
The Basics
Id: 77543
Status: resolved
Priority: 0/
Queue: REST-Client

People
Owner: Nobody in particular
Requestors: BBYRD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Include a setThrottle setting
Many REST APIs have some level of throttling that prevents users from banging on their servers. You should support some sort of method that keeps track of the last call to the server and will sleep if the Throttle is set & has been too short between calls. This could either be done on a per-instance basis or as a %LAST_CALL_TIME global hash that keeps track of servers as the key. Time::HiRes might be a good idea here, too.
Sorry, but I think throttling is an application-level feature, not something that belongs in the rest client itself. Throttling is often accomplished by doing backoff and retries when a client sees status 400 responses as rate limits are exceeded. I think that's a better means of handling rate limitation, and it requires the application to interpret responses from the client. At best, it's just an alternative, and I don't want to add the complexity of a particular means of doing rate limiting to this simple client.