CxnPool/Async/Static/NoPing.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod n/a totaltotal 93.3% 28 / 30 CC 1 SCAR 1.3
CC
1
Cov
96%
__ANON__
2.0
__ANON__
1.0
BEGIN
1.0
CRAP 1.1
« Role/Cxn/Async.pm ↑ Summary Role/Is_Async.pm »
1 package Search::Elasticsearch::CxnPool::Async::Static::NoPing;
2 7 $Search::Elasticsearch::CxnPool::Async::Static::NoPing::VERSION = '6.80';
3 7 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 with 'Search::Elasticsearch::Role::CxnPool::Static::NoPing',
5 'Search::Elasticsearch::Role::Is_Async';
6  
7 7 ▶use Promises qw(deferred);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 7 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 7 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 #===================================
12 around 'next_cxn' => sub {
13 #===================================
14 9 ▶ my ( $orig, $self ) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
15  
16 9 my $deferred = deferred;
17 try {
18 9 ▶ my $cxn = $orig->($self);
Subroutine __ANON__: called CC=1 SCAR=0.0
19 9 $deferred->resolve($cxn);
20 }
21 catch {
22 0 ▶ $deferred->reject($_);
Subroutine __ANON__: not called CC=1 SCAR=6.9
23 9 };
24  
25 9 $deferred->promise;
26  
27 7 };
28  
29 7 1;
30  
31 # ABSTRACT: An async CxnPool for connecting to a remote cluster without the ability to ping.
32  
33 __END__
« Role/Cxn/Async.pm ↑ Summary Role/Is_Async.pm »