LongSteps/Storage.pm

filter: Statementstmt 64.7% 11 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 100% 3 / 3 totaltotal 65.3% 17 / 26 CC 1 SCAR 4.1
CC
1
Cov
65%
prepare_due_processes
2.0
create_process
2.0
find_process
2.0
CRAP 1.5
« LongSteps/Storage/AutoDBIx/Schema/Result/LongstepProcess.pm ↑ Summary LongSteps/Storage/AutoDBIx.pm »
1 package Schedule::LongSteps::Storage;
2 16 $Schedule::LongSteps::Storage::VERSION = '0.021';
3 16 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 =head1 NAME
6  
7 Schedule::LongSteps::Storage - An abstract storage class for steps
8  
9 =cut
10  
11 16 ▶use Data::UUID;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 16 has 'uuid' => ( is => 'ro', isa => 'Data::UUID', lazy_build => 1);
14  
15 sub _build_uuid{
16 13 ▶ my ($self) = @_;
Subroutine _build_uuid: called CC=1 SCAR=0.0
17 13 return Data::UUID->new();
18 }
19  
20  
21  
22 =head2 prepare_due_processes
23  
24 Mark the processes that are due to run as 'running' and
25 returns an array of stored processes.
26  
27 Users: Note that this is meant to be used by L<Schedule::LongSteps>, and not intended
28 to be called directly.
29  
30 Implementors: You will have to implement this method should you wish to implement
31 a new process storage backend.
32  
33 =cut
34  
35 sub prepare_due_processes{
36 0 ▶ my ($self) = @_;
Subroutine prepare_due_processes: not called CC=1 SCAR=6.9
Pod documented
37 0 die "Please implement this in $self";
38 }
39  
40 =head2 create_process
41  
42 Creates and return a new stored process.
43  
44 =cut
45  
46 sub create_process{
47 0 ▶ my ($self, $properties) = @_;
Subroutine create_process: not called CC=1 SCAR=6.9
Pod documented
48 0 die "Please implement this in $self";
49 }
50  
51 =head2 find_process
52  
53 Returns a stored process based on the given ID, or undef if no such thing exists.
54  
55 Usage:
56  
57 my $stored_process = $this->find_process( $pid );
58  
59 =cut
60  
61 sub find_process{
62 0 ▶ my ($self, $pid) = @_;
Subroutine find_process: not called CC=1 SCAR=6.9
Pod documented
63 0 die "Please implement this in $self";
64 }
65  
66  
67 16 __PACKAGE__->meta()->make_immutable();
« LongSteps/Storage/AutoDBIx/Schema/Result/LongstepProcess.pm ↑ Summary LongSteps/Storage/AutoDBIx.pm »