5_0/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::5_0::Role::Scroll;
2 $Search::Elasticsearch::Client::5_0::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 has 'es' => ( is => 'ro', required => 1 );
9 has 'scroll' => ( is => 'ro' );
10 has 'scroll_in_qs' => ( is => 'ro' );
11 has 'total' => ( is => 'rwp' );
12 has 'max_score' => ( is => 'rwp' );
13 has 'facets' => ( is => 'rwp' );
14 has 'aggregations' => ( is => 'rwp' );
15 has 'suggest' => ( is => 'rwp' );
16 has 'took' => ( is => 'rwp' );
17 has 'total_took' => ( is => 'rwp' );
18 has 'search_params' => ( is => 'ro' );
19 has 'is_finished' => ( is => 'rwp', default => '' );
20 has '_pid' => ( is => 'ro', default => sub {$$} );
21 has '_scroll_id' => ( is => 'rwp', clearer => 1, predicate => 1 );
22  
23 #===================================
24 sub scroll_request {
25 #===================================
26 my $self = shift;
27 throw( 'Illegal',
28 'Scroll requests are not fork safe and may only be '
29 . 'refilled by the same process that created the instance.' )
30 if $self->_pid != $$;
31  
32 my %args = ( scroll => $self->scroll );
33 if ( $self->scroll_in_qs ) {
34 $args{scroll_id} = $self->_scroll_id;
35 }
36 else {
37 $args{body} = { scroll_id => $self->_scroll_id };
38 }
39 $self->es->scroll(%args);
40 }
41  
42 #===================================
43 sub DEMOLISH {
44 #===================================
45 my $self = shift or return;
46 return if in_global_destruction;
47 $self->finish;
48 }
49  
50 1;
51  
52 # ABSTRACT: Provides common functionality to L<Search::Elasticsearch::Client::5_0::Scroll> and L<Search::Elasticsearch::Client::5_0::Async::Scroll>
53  
54 __END__