File Coverage

blib/lib/Search/Elasticsearch/Async/Simple.pm
Criterion Covered Total %
statement 12 19 63.1
branch 0 6 0.0
condition 0 3 0.0
subroutine 4 5 80.0
pod 0 1 0.0
total 16 34 47.0


line stmt bran cond sub pod time code
1             package Search::Elasticsearch::Async::Simple;
2              
3 1     1   35280 use Moo;
  1         31407  
  1         6  
4              
5 1     1   2520 use Search::Elasticsearch 1.10;
  1         47366  
  1         30  
6 1     1   9 use Search::Elasticsearch::Util qw(parse_params);
  1         2  
  1         6  
7              
8 1     1   241 use namespace::clean;
  1         2  
  1         4  
9              
10             extends 'Search::Elasticsearch';
11              
12              
13             our $VERSION = '0.03';
14              
15              
16             sub new {
17 0     0 0   my ($class, $pars) = parse_params(@_);
18              
19 0           for (qw(client cxn cxn_pool transport)) {
20 0 0 0       next unless exists($pars->{$_}) && defined($pars->{$_});
21 0 0         next if index($pars->{$_}, '+') == 0;
22 0 0         next if index($pars->{$_}, 'Async::Simple') == 0;
23              
24 0           $pars->{$_} = 'Async::Simple::' . $pars->{$_};
25             }
26              
27 0           return $class->SUPER::new({
28             client => 'Async::Simple::Direct',
29             transport => 'Async::Simple',
30             cxn_pool => 'Async::Simple::Static',
31             cxn => 'Async::Simple::AEHTTP',
32             %$pars,
33             });
34             }
35              
36              
37             1;
38              
39              
40             __END__