line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Cache::RemovalStrategy - abstract Removal Strategy interface for a Cache |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 DESCRIPTION |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 METHODS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=over |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
12
|
|
|
|
|
|
|
package Cache::RemovalStrategy; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
require 5.006; |
15
|
7
|
|
|
7
|
|
1376
|
use strict; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
300
|
|
16
|
7
|
|
|
7
|
|
44
|
use warnings; |
|
7
|
|
|
|
|
344
|
|
|
7
|
|
|
|
|
201
|
|
17
|
7
|
|
|
7
|
|
49
|
use Carp; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
1448
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '2.10'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
7
|
|
|
7
|
0
|
16
|
my Cache::RemovalStrategy $self = shift; |
24
|
|
|
|
|
|
|
|
25
|
7
|
50
|
|
|
|
198
|
ref $self or croak 'Must use a subclass of Cache::RemovalStrategy'; |
26
|
7
|
|
|
|
|
57
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=item $r->remove_size( $cache, $size ) |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
When invoked, removes entries from the cache that total at least $size in |
33
|
|
|
|
|
|
|
size. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub remove_size; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
__END__ |