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

filter: Statementstmt 72.0% 18 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 71.8% 23 / 32 CC 1 SCAR 1.5
CC
1
Cov
72%
establish_primary_connection
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Net/Async/Redis/Cluster/XS.pm ↑ Summary XS.xs »
1 package Net::Async::Redis::Cluster::Node::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::Node);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 Net::Async::Redis::Cluster::Node::XS - like L<Net::Async::Redis::Cluster::Node> but faster
13  
14 =head1 DESCRIPTION
15  
16 This is a wrapper around L<Net::Async::Redis::Cluster::Node> for using the XS versions
17 of the protocol handling.
18  
19 API and behaviour should be identical to L<Net::Async::Redis::Cluster::Node>, see there
20 for instructions.
21  
22 =cut
23  
24 1 ▶use Net::Async::Redis::XS;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use Future::AsyncAwait;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 0 ▶async sub establish_primary_connection {
Subroutine establish_primary_connection: not called CC=1 SCAR=6.9
Pod undocumented
28 0 my ($self) = @_;
29  
30 0 $self->add_child(
31 my $redis = Net::Async::Redis::XS->new(
32 $self->Net::Async::Redis::Cluster::node_config,
33 host => $self->primary->[0],
34 port => $self->primary->[1],
35 )
36 );
37 0 $self->{primary_connection} = $redis;
38 0 await $redis->connected;
39 0 await $self->cluster->node_connection_established($self, $redis);
40 0 return $redis;
41 1 }
42  
43 1 1;
44  
45 =head1 AUTHOR
46  
47 Tom Molesworth <TEAM@cpan.org>
48  
49 =head1 LICENSE
50  
51 Copyright Tom Molesworth 2022. Licensed under the same terms as Perl itself.
52  
« blib/lib/Net/Async/Redis/Cluster/XS.pm ↑ Summary XS.xs »