line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Job::Async::Client::Memory; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
120324
|
use strict; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
61
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
63
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
428
|
use parent qw(Job::Async::Client); |
|
2
|
|
|
|
|
307
|
|
|
2
|
|
|
|
|
10
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.003'; # 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
|
30
|
sub start { Future->done } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub submit { |
24
|
2532
|
|
|
2532
|
1
|
7115
|
my ($self, %args) = @_; |
25
|
2532
|
|
|
|
|
9421
|
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
|
|
|
|
|
11461
|
$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
|
|
|
|
|
|
|
|