0_90/Role/Scroll.pm untested

filter: Statementstmt 0.0% 0 / 40 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 57 CC 4 SCAR 18.3
CC
4
Cov
0%
scroll_request
12.0
DEMOLISH
6.0
BEGIN
2.0
CRAP 6.2
1 package Search::Elasticsearch::Client::0_90::Role::Scroll;
2 $Search::Elasticsearch::Client::0_90::Role::Scroll::VERSION = '6.81';
3 use Moo::Role;
4 requires 'finish';
5 use Search::Elasticsearch::Util qw(parse_params throw);
6 use Devel::GlobalDestruction;
7 use namespace::clean;
8  
9 has 'es' => ( is => 'ro', required => 1 );
10 has 'scroll' => ( is => 'ro' );
11 has 'scroll_in_qs' => ( is => 'ro' );
12 has 'total' => ( is => 'rwp' );
13 has 'max_score' => ( is => 'rwp' );
14 has 'facets' => ( is => 'rwp' );
15 has 'aggregations' => ( is => 'rwp' );
16 has 'suggest' => ( is => 'rwp' );
17 has 'took' => ( is => 'rwp' );
18 has 'total_took' => ( is => 'rwp' );
19 has 'search_params' => ( is => 'ro' );
20 has 'is_finished' => ( is => 'rwp', default => '' );
21 has '_pid' => ( is => 'ro', default => sub {$$} );
22 has '_scroll_id' => ( is => 'rwp', clearer => 1, predicate => 1 );
23  
24 #===================================
25 sub scroll_request {
26 #===================================
27 my $self = shift;
28 throw( 'Illegal',
29 'Scroll requests are not fork safe and may only be '
30 . 'refilled by the same process that created the instance.' )
31 if $self->_pid != $$;
32  
33 my %args = ( scroll => $self->scroll );
34 if ( $self->scroll_in_qs ) {
35 $args{scroll_id} = $self->_scroll_id;
36 }
37 else {
38 $args{body} = $self->_scroll_id;
39 }
40 $self->es->scroll(%args);
41 }
42  
43 #===================================
44 sub DEMOLISH {
45 #===================================
46 my $self = shift or return;
47 return if in_global_destruction;
48 $self->finish;
49 }
50  
51 1;
52  
53 # ABSTRACT: Provides common functionality to L<Search::Elasticsearch::Client::0_90::Scroll> and L<Search::Elasticsearch::Client::0_90::Async::Scroll>
54  
55 __END__