Skip to content

Added Pacemaker module.#4

Open
chrismo wants to merge 1 commit intothecity:masterfrom
chrismo:pacemaker
Open

Added Pacemaker module.#4
chrismo wants to merge 1 commit intothecity:masterfrom
chrismo:pacemaker

Conversation

@chrismo
Copy link
Contributor

@chrismo chrismo commented Dec 26, 2012

[submitting a pull request for your review, but prolly don't think
this is worthwhile as-is].

The Pacemaker module is one approach to allowing a long running script
to pace itself according to API rate limits. It's a bit coarse and after
using it some, there doesn't seem to be much advantage to pacing the
final few calls across the remaining minutes of the hour vs. just one
big sleep at the end, but I still wanted to keep the experiment.

To properly decide if pacing the calls throughout the hour is
worthwhile, the total number of calls would need to be fed to the
calculation. Pacing all the time is a waste if there will be less calls
in the hour than the limit remaining.

In addition, if there will be more calls than the limit remaining, then
choosing to pace versus one long wait once the limit is exhausted
results in the same amount of time waiting, so there seems to be little
advantage to pacing at all.

The Pacemaker module is one approach to allowing a long running script
to pace itself according to API rate limits. It's a bit coarse and after
using it some, there doesn't seem to be much advantage to pacing the
final few calls across the remaining minutes of the hour vs. just one
big sleep at the end, but I still wanted to keep the experiment.

To properly decide if pacing the calls throughout the hour is
worthwhile, the total number of calls would need to be fed to the
calculation. Pacing all the time is a waste if there will be less calls
in the hour than the limit remaining.

In addition, if there will be more calls than the limit remaining, then
choosing to pace versus one long wait once the limit is exhausted
results in the same amount of time waiting, so there seems to be little
advantage to pacing at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant