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