| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Catmandu::Flushable; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
110614
|
use Catmandu::Sane; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
|
6
|
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
7
|
use Moo::Role; |
|
|
1
|
|
|
|
|
6
|
|
|
|
1
|
|
|
|
|
6
|
|
|
8
|
1
|
|
|
1
|
|
430
|
use namespace::clean; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
7
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
requires 'commit'; |
|
11
|
|
|
|
|
|
|
requires 'flush'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
before commit => sub { |
|
14
|
|
|
|
|
|
|
$_[0]->flush; |
|
15
|
|
|
|
|
|
|
}; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
1; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
__END__ |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=pod |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 NAME |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Catmandu::Flushable - Optional role for flushable bags |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
C<flush> makes sure that data added get persisted to disk for stores that |
|
30
|
|
|
|
|
|
|
support this operation (e.g. Elasticsearch). |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
This role also installs a hook that calls C<flush> on C<commit>. |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
$store->bag->flush; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 METHODS |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 flush |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Flush the bag. |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
|
45
|
|
|
|
|
|
|
|