lib/Flux/Storage/Memory/In.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 4 totaltotal 88.8% 32 / 36 CC 2 SCAR 2.5
CC
2
Cov
100%
read
2.0
BEGIN
1.0
__ANON__
1.0
CRAP 1.3
« lib/Flux/Simple/ArrayIn.pm ↑ Summary lib/Flux/Storage/Role/ClientList.pm »
1 package Flux::Storage::Memory::In;
2 {
3 2 $Flux::Storage::Memory::In::VERSION = '1.03';
4 }
5  
6 # ABSTRACT: in-memory input stream for Flux::MemoryStorage
7  
8 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 with
10 'Flux::In::Role::Easy',
11 'Flux::In::Role::Lag';
12  
13 2 has 'storage' => (
14 is => 'ro',
15 required => 1,
16 );
17  
18 2 has 'client' => (
19 is => 'ro',
20 required => 1,
21 );
22  
23 has 'pos' => (
24 is => 'rw',
25 lazy => 1,
26 7 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
27 7 my $self = shift;
28 7 return $self->storage->_get_client_pos($self->client);
29 },
30 2 );
31  
32 16 ▶sub read {
Subroutine read: called CC=2 SCAR=6.9
Pod undocumented
33 16 my $self = shift;
34 16 my $item = $self->storage->_read($self->pos);
35 16 ▶ return unless $item;
Branch: 1 branch
BranchTrueFalseTotal
unless $item 4 12 16
36 12 $self->pos($self->pos + 1);
37 12 return $item;
38 }
39  
40 2 ▶sub commit {
Subroutine commit: called CC=1 SCAR=0.0
Pod undocumented
41 2 my $self = shift;
42 2 $self->storage->_set_client_pos($self->client, $self->pos);
43 }
44  
45 3 ▶sub lag {
Subroutine lag: called CC=1 SCAR=0.0
Pod undocumented
46 3 my $self = shift;
47 3 return $self->storage->_lag($self->pos);
48 }
49  
50 8 ▶sub DEMOLISH {
Subroutine DEMOLISH: called CC=1 SCAR=0.0
Pod undocumented
51 8 local $@;
52 8 my $self = shift;
53 8 $self->storage->_unlock_client($self->client);
54 }
55  
56 2 1;
57  
58 __END__
« lib/Flux/Simple/ArrayIn.pm ↑ Summary lib/Flux/Storage/Role/ClientList.pm »