blib/lib/Net/Async/Redis/Cluster/XS.pm

filter: Statementstmt 69.2% 18 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 67.6% 23 / 34 CC 2 SCAR 8.9
CC
2
Cov
64%
bootstrap
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.4
« blib/lib/Net/Async/Redis/XS.pm ↑ Summary blib/lib/Net/Async/Redis/Cluster/Node/XS.pm »
1 package Net::Async::Redis::Cluster::XS;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '0.006'; # VERSION
7  
8 1 ▶use parent qw(Net::Async::Redis::Cluster);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 Net::Async::Redis::Cluster::XS - like L<Net::Async::Redis::Cluster> but faster
13  
14 =head1 DESCRIPTION
15  
16 This is a wrapper around L<Net::Async::Redis::Cluster> with faster protocol parsing.
17  
18 API and behaviour should be identical to L<Net::Async::Redis::Cluster>, see there for instructions.
19  
20 =cut
21  
22 1 ▶use Net::Async::Redis::XS;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use Future::AsyncAwait;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 0 ▶async sub bootstrap {
Subroutine bootstrap: not called CC=2 SCAR=17.9
26 0 my ($self, %args) = @_;
27 0 my $redis;
28 try {
29 $self->add_child(
30 $redis = Net::Async::Redis::XS->new(
31 host => $args{host},
32 port => $args{port},
33 )
34 0 );
35 0 await $redis->connect;
36 0 await $self->apply_slots_from_instance($redis);
37 0 } finally {
38 0 ▶ $redis->remove_from_parent if $redis;
Branch: 1 branch
BranchTrueFalseTotal
if $redis 0 0 0
39 }
40 1 }
41  
42 1 1;
43  
44 =head1 AUTHOR
45  
46 Tom Molesworth <TEAM@cpan.org>
47  
48 =head1 LICENSE
49  
50 Copyright Tom Molesworth 2022. Licensed under the same terms as Perl itself.
51  
« blib/lib/Net/Async/Redis/XS.pm ↑ Summary blib/lib/Net/Async/Redis/Cluster/Node/XS.pm »