File Coverage

blib/lib/Job/Async/Client/Memory.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 2 50.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package Job::Async::Client::Memory;
2              
3 2     2   99209 use strict;
  2         14  
  2         52  
4 2     2   10 use warnings;
  2         4  
  2         52  
5              
6 2     2   360 use parent qw(Job::Async::Client);
  2         271  
  2         10  
7              
8             our $VERSION = '0.004'; # VERSION
9              
10             =head1 NAME
11              
12             Job::Async::Client::Memory - basic in-memory job client for L
13              
14             =head1 DESCRIPTION
15              
16             This is intended as an example, and for testing code. It's not
17             very useful in a real application.
18              
19             =cut
20              
21 1     1 0 26 sub start { Future->done }
22              
23             sub submit {
24 2532     2532 1 6148 my ($self, %args) = @_;
25 2532         8002 push @Job::Async::Memory::PENDING_JOBS, my $job = Job::Async::Job->new(
26             data => \%args,
27             id => rand(1e9),
28             future => $self->loop->new_future,
29             );
30 2532         9555 $job
31             }
32              
33             1;
34              
35             =head1 AUTHOR
36              
37             Tom Molesworth
38              
39             =head1 LICENSE
40              
41             Copyright Tom Molesworth 2016-2017. Licensed under the same terms as Perl itself.
42