This module provides a way to voluntarily restrict how many times a given action may take place within a specified time frame. Such a tool may be useful if you have written something which periodically polls some public resource and want to ensure that you do not overburden that resource with too many requests.
# Don't let this event happen more than 5 times in a 60 second period. my $throttle = Schedule::RateLimiter->new ( iterations => 5,
seconds => 60 );
# Cycle forever, but not too fast.
while ( $throttle->event() ) {
&do_something;
}
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires these other modules and libraries:
Test::More
Time::HiRest
TODO
COPYRIGHT AND LICENCE
This module was authored by Daniel J. Wright (wright@pair.com) for pair Networks, Inc.
Copyright (C) 2003 pair Networks, Inc. (www.pair.com)
This module is licensed under the same license at Perl itself.