line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Flux::Mapper::Anon; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Flux::Mapper::Anon::VERSION = '1.03'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: callback-style mapper |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
7
|
|
|
7
|
|
30736
|
use Moo; |
|
7
|
|
|
|
|
16943
|
|
|
7
|
|
|
|
|
36
|
|
10
|
|
|
|
|
|
|
with 'Flux::Mapper::Role::Easy'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'cb' => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
required => 1, |
15
|
|
|
|
|
|
|
# CODEREF |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has 'commit_cb' => ( |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
# CODEREF |
21
|
|
|
|
|
|
|
default => sub { |
22
|
|
|
|
|
|
|
sub { return } |
23
|
|
|
|
|
|
|
}, |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub write { |
27
|
15
|
|
|
15
|
0
|
49
|
my ($self, $item) = @_; |
28
|
15
|
|
|
|
|
65
|
return $self->cb->($item); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub commit { |
32
|
2
|
|
|
2
|
0
|
491
|
my ($self) = @_; |
33
|
2
|
|
|
|
|
32
|
return $self->commit_cb->(); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |