line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Curio::Role::CHI; |
2
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
622920
|
use CHI; |
|
2
|
|
|
|
|
78400
|
|
|
2
|
|
|
|
|
73
|
|
5
|
2
|
|
|
2
|
|
19
|
use Scalar::Util qw( blessed ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
149
|
|
6
|
2
|
|
|
2
|
|
13
|
use Types::Standard qw( InstanceOf HashRef ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
25
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1549
|
use Moo::Role; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
18
|
|
9
|
2
|
|
|
2
|
|
805
|
use strictures 2; |
|
2
|
|
|
|
|
60
|
|
|
2
|
|
|
|
|
100
|
|
10
|
2
|
|
|
2
|
|
419
|
use namespace::clean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
18
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Curio::Role'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
after initialize => sub{ |
15
|
|
|
|
|
|
|
my ($class) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $factory = $class->factory(); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$factory->does_caching( 1 ); |
20
|
|
|
|
|
|
|
$factory->cache_per_process( 1 ); |
21
|
|
|
|
|
|
|
$factory->resource_method_name( 'chi' ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
return; |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has _custom_chi => ( |
27
|
|
|
|
|
|
|
is => 'ro', |
28
|
|
|
|
|
|
|
isa => InstanceOf[ 'CHI::Driver' ] | HashRef, |
29
|
|
|
|
|
|
|
required => 1, |
30
|
|
|
|
|
|
|
init_arg => 'chi', |
31
|
|
|
|
|
|
|
clearer => '_clear_custom_chi', |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has chi => ( |
35
|
|
|
|
|
|
|
is => 'lazy', |
36
|
|
|
|
|
|
|
init_arg => undef, |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _build_chi { |
40
|
3
|
|
|
3
|
|
119867
|
my ($self) = @_; |
41
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
28
|
my $chi = $self->_custom_chi(); |
43
|
3
|
|
|
|
|
60
|
$self->_clear_custom_chi(); |
44
|
3
|
50
|
|
|
|
33
|
return $chi if blessed $chi; |
45
|
|
|
|
|
|
|
|
46
|
3
|
|
|
|
|
29
|
return CHI->new( %$chi ); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
__END__ |