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.715';
21 60     60   3108718 use Search::Elasticsearch 7.00;
  60         2533001  
  60         1912  
22 60     60   21677 use Promises 0.93 ();
  60         217023  
  60         1509  
23 60     60   405 use parent 'Search::Elasticsearch';
  60         119  
  60         386  
24              
25 60     60   4418 use Search::Elasticsearch::Util qw(parse_params);
  60         137  
  60         383  
26 60     60   13275 use namespace::clean;
  60         119  
  60         363  
27              
28              
29             #===================================
30             sub new {
31             #===================================
32 86     86 0 102273 my ( $class, $params ) = parse_params(@_);
33 86         2115 my $self = $class->SUPER::new(
34             { cxn_pool => 'Async::Static',
35             transport => 'Async',
36             cxn => 'AEHTTP',
37             %$params
38             }
39             );
40 86 50       3741143 unless ( $self->bulk_helper_class ) {
41 86         538 $self->bulk_helper_class(
42             'Client::' . $self->api_version . '::Async::Bulk' );
43             }
44 86 50       342 unless ( $self->scroll_helper_class ) {
45 86         394 $self->scroll_helper_class(
46             'Client::' . $self->api_version . '::Async::Scroll' );
47             }
48 86         1353 return $self;
49             }
50              
51             1;
52              
53             # ABSTRACT: Async API for Elasticsearch using Promises
54              
55             __END__