File Coverage

blib/lib/Search/Elasticsearch/Async.pm
Criterion Covered Total %
statement 22 22 100.0
branch 2 4 50.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 30 33 90.9


line stmt bran cond sub pod time code
1             # Licensed to Elasticsearch B.V. under one or more contributor
2             # license agreements. See the NOTICE file distributed with
3             # this work for additional information regarding copyright
4             # ownership. Elasticsearch B.V. licenses this file to you under
5             # the Apache License, Version 2.0 (the "License"); you may
6             # not use this file except in compliance with the License.
7             # You may obtain a copy of the License at
8             #
9             # http://www.apache.org/licenses/LICENSE-2.0
10             #
11             # Unless required by applicable law or agreed to in writing,
12             # software distributed under the License is distributed on an
13             # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14             # KIND, either express or implied. See the License for the
15             # specific language governing permissions and limitations
16             # under the License.
17              
18             package Search::Elasticsearch::Async;
19              
20             our $VERSION = '7.717';
21 60     60   2744710 use Search::Elasticsearch 7.00;
  60         2233093  
  60         1695  
22 60     60   18839 use Promises 0.93 ();
  60         188697  
  60         1332  
23 60     60   404 use parent 'Search::Elasticsearch';
  60         112  
  60         356  
24              
25 60     60   4207 use Search::Elasticsearch::Util qw(parse_params);
  60         108  
  60         363  
26 60     60   12511 use namespace::clean;
  60         112  
  60         323  
27              
28              
29             #===================================
30             sub new {
31             #===================================
32 86     86 0 87470 my ( $class, $params ) = parse_params(@_);
33 86         1984 my $self = $class->SUPER::new(
34             { cxn_pool => 'Async::Static',
35             transport => 'Async',
36             cxn => 'AEHTTP',
37             %$params
38             }
39             );
40 86 50       3311375 unless ( $self->bulk_helper_class ) {
41 86         495 $self->bulk_helper_class(
42             'Client::' . $self->api_version . '::Async::Bulk' );
43             }
44 86 50       300 unless ( $self->scroll_helper_class ) {
45 86         374 $self->scroll_helper_class(
46             'Client::' . $self->api_version . '::Async::Scroll' );
47             }
48 86         1284 return $self;
49             }
50              
51             1;
52              
53             # ABSTRACT: Async API for Elasticsearch using Promises
54              
55             __END__