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   102395 use strict;
  2         13  
  2         56  
4 2     2   9 use warnings;
  2         4  
  2         44  
5              
6 2     2   335 use parent qw(Job::Async::Client);
  2         226  
  2         11  
7              
8             our $VERSION = '0.002'; # 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 22 sub start { Future->done }
22              
23             sub submit {
24 2532     2532 1 5966 my ($self, %args) = @_;
25 2532         7563 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         8980 $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