Access to throttled API

2012-11-30 Thread DAVID HODGKINSON

So, I might be writing an app to access a throttled API. Say 
we're limited to sixty requests per minute. It's entirely possible
that we generate more requests than that at peak times.

The app is not especially immediacy-sensitive for things like
reporting. The remote system can take its time generating
reports so for some things, showing pending isn't a dead loss,
we can always re-run the request later to get the data.

There should be some form of global throttle manager just keeping
track of our usage. All our user interaction can be logged in the 
database and pulled out and actioned by some form of daemon maybe?
The daemon can even prioritise interactive operations agains the 
longer batchy one and unfilfilled reports.

Thoughts on managing this?





Re: Access to throttled API

2012-11-30 Thread Philippe Bruhat (BooK)
On Fri, Nov 30, 2012 at 11:54:57AM +, DAVID HODGKINSON wrote:
 
 There should be some form of global throttle manager just keeping
 track of our usage. All our user interaction can be logged in the 
 database and pulled out and actioned by some form of daemon maybe?
 The daemon can even prioritise interactive operations agains the 
 longer batchy one and unfilfilled reports.
 
 Thoughts on managing this?
 

Are you looking for a generic throttling module?

If so, you can try Schedule::AdaptiveThrottler.

-- 
 Philippe Bruhat (BooK)

 When you wander near evil, Security is only a function of foolishness...
(Moral from Groo The Wanderer #21 (Epic))