line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Curio::Role::CHI; |
2
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
732531
|
use CHI; |
|
2
|
|
|
|
|
73061
|
|
|
2
|
|
|
|
|
65
|
|
5
|
2
|
|
|
2
|
|
17
|
use Scalar::Util qw( blessed ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
155
|
|
6
|
2
|
|
|
2
|
|
12
|
use Types::Standard qw( InstanceOf HashRef ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
17
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1637
|
use Moo::Role; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
18
|
|
9
|
2
|
|
|
2
|
|
719
|
use strictures 2; |
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
67
|
|
10
|
2
|
|
|
2
|
|
373
|
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
|
|
109729
|
my ($self) = @_; |
41
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
28
|
my $chi = $self->_custom_chi(); |
43
|
3
|
|
|
|
|
47
|
$self->_clear_custom_chi(); |
44
|
3
|
50
|
|
|
|
29
|
return $chi if blessed $chi; |
45
|
|
|
|
|
|
|
|
46
|
3
|
|
|
|
|
24
|
return CHI->new( %$chi ); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
__END__ |