| 1 | package Pithub::Result::SharedCache; | ||
| 2 | 24 | our $AUTHORITY = 'cpan:PLU'; | |
| 3 | |||
| 4 | 24 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 24 | our $VERSION = '0.01041'; | |
| 7 | |||
| 8 | # ABSTRACT: A role to share the LRU cache with all Pithub objects | ||
| 9 | |||
| 10 | 24 | ▶ | use CHI (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 24 | my $store = {}; | |
| 13 | |||
| 14 | 24 | 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 | ▶ | return $Shared_Cache; |
|
Subroutine
shared_cache: called CC=1 SCAR=0.0
Pod
documented
| |||
| 24 | } | ||
| 25 | |||
| 26 | |||
| 27 | sub set_shared_cache { | ||
| 28 | 0 | ▶ | my ( $self, $cache ) = @_; |
|
Subroutine
set_shared_cache: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 29 | |||
| 30 | 0 | $Shared_Cache = $cache; | |
| 31 | |||
| 32 | 0 | return; | |
| 33 | } | ||
| 34 | |||
| 35 | 24 | 1; | |
| 36 | |||
| 37 | __END__ | ||