Algorithm-LeakyBucket

 view release on metacpan or  search on metacpan

lib/Algorithm/LeakyBucket.pm  view on Meta::CPAN

sub mc_write
{
	my ($self, %args) = @_;
	$self->memcached->set($self->memcached_key, $self->current_allowed . '|' . $self->last_tick);
	return;
}

=head1 BUGS

Probably some.  There is a known bug where if you are in an infinite loop you could move faster than
memcached could be updated remotely, so you'll likely at that point only bbe limted by the local 
counters.  I'm not sure how im going to fix this yet as this is in early development.

=head1 TODO

Will need to look at including some actual tests im thinking.  Maybe once we get more real usage out
of this in our produciton environment some test cases will make themselves obvious.
 
=head1 SEE ALSO

http://en.wikipedia.org/wiki/Leaky_bucket



( run in 0.232 second using v1.01-cache-2.11-cpan-05444aca049 )