| 1 | package Iterator::Flex::Role::Exhaustion::Throw; | ||||||||||
| 2 | |||||||||||
| 3 | # ABSTRACT: signal exhaustion by setting exhausted flag and throwing; | ||||||||||
| 4 | |||||||||||
| 5 | 17 | ▶ | use v5.28; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 17 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 17 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 17 | our $VERSION = '0.33'; | |||||||||
| 10 | |||||||||||
| 11 | 17 | ▶ | use Ref::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 17 | ▶ | use Iterator::Flex::Utils qw( :default REG_GENERAL REG_GP_EXHAUSTION ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 17 | ▶ | use Role::Tiny; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 17 | ▶ | use experimental 'signatures'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | 17 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | |||||||||||
| 22 | |||||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | |||||||||||
| 26 | |||||||||||
| 27 | |||||||||||
| 28 | |||||||||||
| 29 | ▶ | sub signal_exhaustion ( $self, @ ) { | |||||||||
|
Subroutine
signal_exhaustion: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 30 | 93 | $self->set_exhausted; | |||||||||
| 31 | |||||||||||
| 32 | 93 | my $exception = $REGISTRY{ refaddr $self }[REG_GENERAL][REG_GP_EXHAUSTION][1]; | |||||||||
| 33 | |||||||||||
| 34 | 93 | ▶ | $exception->() if Ref::Util::is_coderef( $exception ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | |||||||||||
| 36 | 93 | require Iterator::Flex::Failure; | |||||||||
| 37 | 93 | Iterator::Flex::Failure::Exhausted->throw; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | |||||||||||
| 41 | 17 | 1; | |||||||||
| 42 | |||||||||||
| 43 | # | ||||||||||
| 44 | # This file is part of Iterator-Flex | ||||||||||
| 45 | # | ||||||||||
| 46 | # This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory. | ||||||||||
| 47 | # | ||||||||||
| 48 | # This is free software, licensed under: | ||||||||||
| 49 | # | ||||||||||
| 50 | # The GNU General Public License, Version 3, June 2007 | ||||||||||
| 51 | # | ||||||||||
| 52 | |||||||||||
| 53 | __END__ | ||||||||||