line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pithub::Result::SharedCache; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:PLU'; |
3
|
|
|
|
|
|
|
|
4
|
24
|
|
|
24
|
|
195027
|
use Moo::Role; |
|
24
|
|
|
|
|
54
|
|
|
24
|
|
|
|
|
137
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01040'; |
7
|
|
|
|
|
|
|
# ABSTRACT: A role to share the LRU cache with all Pithub objects |
8
|
|
|
|
|
|
|
|
9
|
24
|
|
|
24
|
|
20100
|
use CHI (); |
|
24
|
|
|
|
|
815334
|
|
|
24
|
|
|
|
|
2116
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $store = {}; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $Shared_Cache = CHI->new( |
14
|
|
|
|
|
|
|
datastore => $store, |
15
|
|
|
|
|
|
|
driver => 'RawMemory', |
16
|
|
|
|
|
|
|
max_size => 200, |
17
|
|
|
|
|
|
|
size => 200, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub shared_cache { |
22
|
1136
|
|
|
1136
|
1
|
4533
|
return $Shared_Cache; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub set_shared_cache { |
27
|
0
|
|
|
0
|
1
|
|
my($self, $cache) = @_; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
$Shared_Cache = $cache; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
return; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |