Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Pacemaker module. #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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