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 = '8.00';
21 70     70   3947338 use Search::Elasticsearch 8.00;
  70         3194681  
  70         2523  
22 70     70   22888 use Promises 0.93 ();
  70         237398  
  70         1858  
23 70     70   483 use parent 'Search::Elasticsearch';
  70         152  
  70         506  
24              
25 70     70   5383 use Search::Elasticsearch::Util qw(parse_params);
  70         165  
  70         452  
26 70     70   18116 use namespace::clean;
  70         216  
  70         396  
27              
28              
29             #===================================
30             sub new {
31             #===================================
32 86     86 0 117222 my ( $class, $params ) = parse_params(@_);
33 86         2462 my $self = $class->SUPER::new(
34             { cxn_pool => 'Async::Static',
35             transport => 'Async',
36             cxn => 'AEHTTP',
37             %$params
38             }
39             );
40 86 50       4133528 unless ( $self->bulk_helper_class ) {
41 86         655 $self->bulk_helper_class(
42             'Client::' . $self->api_version . '::Async::Bulk' );
43             }
44 86 50       445 unless ( $self->scroll_helper_class ) {
45 86         463 $self->scroll_helper_class(
46             'Client::' . $self->api_version . '::Async::Scroll' );
47             }
48 86         1549 return $self;
49             }
50              
51             1;
52              
53             # ABSTRACT: Async API for Elasticsearch using Promises
54              
55             __END__