File Coverage

blib/lib/Schedule/LongSteps/Storage.pm
Criterion Covered Total %
statement 8 14 57.1
branch n/a
condition n/a
subroutine 3 6 50.0
pod 3 3 100.0
total 14 23 60.8


line stmt bran cond sub pod time code
1             package Schedule::LongSteps::Storage;
2             $Schedule::LongSteps::Storage::VERSION = '0.021';
3 16     16   8029 use Moose;
  16         37  
  16         106  
4              
5             =head1 NAME
6              
7             Schedule::LongSteps::Storage - An abstract storage class for steps
8              
9             =cut
10              
11 16     16   108626 use Data::UUID;
  16         8650  
  16         3308  
12              
13             has 'uuid' => ( is => 'ro', isa => 'Data::UUID', lazy_build => 1);
14              
15             sub _build_uuid{
16 13     13   40 my ($self) = @_;
17 13         1687 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     0 1   my ($self) = @_;
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     0 1   my ($self, $properties) = @_;
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     0 1   my ($self, $pid) = @_;
63 0           die "Please implement this in $self";
64             }
65              
66              
67             __PACKAGE__->meta()->make_immutable();