Gungho/Component/Throttle/Throttler.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 38 CC 2 SCAR 12.8
CC
2
Cov
0%
prepare_throttler
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.6
1 # $Id: /mirror/gungho/lib/Gungho/Component/Throttle/Throttler.pm 3224 2007-10-10T08:08:59.964068Z lestrrat $
2 #
3 # Copyright (c) 2007 Daisuke Maki <daisuke@endeworks.jp>
4 # All rights reserved.
5  
6 package Gungho::Component::Throttle::Throttler;
7 use strict;
8 use warnings;
9 use base qw(Gungho::Component::Throttle);
10  
11 __PACKAGE__->mk_classdata($_) for qw(throttler);
12  
13 sub prepare_throttler
14 {
15 my $self = shift;
16 my %args = @_;
17  
18 my $class = delete $args{throttler} || 'Data::Throttler';
19 if (! Class::Inspector->loaded($class)) {
20 $class->require or die;
21 }
22  
23 $args{max_items} ||= 1000;
24 $args{interval} ||= 3600;
25  
26 $self->throttler( $class->new( %args ) );
27 }
28  
29 1;
30  
31 __END__