Daisuke Maki > Data-Valve-0.00005 > Data::Valve

Download:
Data-Valve-0.00005.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.00005   Source   Latest Release: Data-Valve-0.00010

NAME ^

Data::Valve - Throttle Your Data

SYNOPSIS ^

  use Data::Valve;

  my $valve = Data::Valve->new(
    max_items => 10,
    interval  => 30
  );

  if ($valve->try_push()) {
    print "ok\n";
  } else {
    print "throttled\n";
  }

  if ($valve->try_push(key => "foo")) {
    print "ok\n";
  } else {
    print "throttled\n";
  }

DESCRIPTION ^

Data::Valve is a throttler based on Data::Throttler. The underlying throttling mechanism is much simpler than Data::Throttler, and so is faster.

It also comes with Memcached support for a distributed throttling.

METHODS ^

try_push([key => $key_name])

AUTHOR ^

Daisuke Maki <daisuke@endeworks.jp>

LICENSE ^

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html