AMQP/ConnectionManager/Connection.pm

filter: Statementstmt 43.3% 13 / 30 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 3 / 9 Podpod 100% 3 / 3 totaltotal 37.2% 19 / 51 CC 4 SCAR 15.2
CC
4
Cov
35%
DESTROY
12.0
AUTOLOAD
3.9
new
2.0
CRAP 4.6
« AMQP/RPC/Client.pm ↑ Summary AMQP/Server/Protocol.pm »
1 package Net::Async::AMQP::ConnectionManager::Connection;
2 6 $Net::Async::AMQP::ConnectionManager::Connection::VERSION = '2.000';
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head1 NAME
7  
8 Net::Async::AMQP::ConnectionManager::Connection - connection proxy object
9  
10 =head1 VERSION
11  
12 version 2.000
13  
14 =head1 METHODS
15  
16 =head2 new
17  
18 Instantiate.
19  
20 =cut
21  
22 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
23 0 my $class = shift;
24 0 bless { @_ }, $class
25 }
26  
27 =head2 amqp
28  
29 Returns the underlying AMQP instance.
30  
31 =cut
32  
33 0 ▶sub amqp { shift->{amqp} }
Subroutine amqp: not called CC=1 SCAR=6.9
Pod documented
34  
35 =head2 manager
36  
37 Returns our ConnectionManager instance.
38  
39 =cut
40  
41 0 ▶sub manager { shift->{manager} }
Subroutine manager: not called CC=1 SCAR=6.9
Pod documented
42  
43 =head2 DESTROY
44  
45 On destruction we release the connection by informing the connection manager
46 that we no longer require the data.
47  
48 =cut
49  
50 0 ▶sub DESTROY {
Subroutine DESTROY: not called CC=3 SCAR=24.8
51 0 my $self = shift;
52 0 my $conman = delete $self->{manager};
53 0 my $amqp = delete $self->{amqp};
54 0 ▶ $conman->release_connection($amqp) if $conman && $amqp;
Branch: 1 branch
BranchTrueFalseTotal
if $conman and $amqp 0 0 0
Condition0%0/3
$conman and $amqp
!ll&&!rl&&r
000
MC/DC0%0/2
$conman and $amqp
$conman $amqp
Truth table0%0/3
A and B
A= $conmanB= $amqp
ABresult
0X0
100
111
55 }
56  
57 {
58 6 our $AUTOLOAD;
59 0 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: not called CC=2 SCAR=13.7
60 0 my ($self, @args) = @_;
61 0 (my $method = $AUTOLOAD) =~ s/.*:://;
62 0 ▶ die "attempt to proxy unknown method $method for $self" unless $self->amqp->can($method);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->amqp->can($method) 0 0 0
63 0 ▶ my $code = sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
64 0 my $self = shift;
65 0 $self->amqp->$method(@_);
66 0 };
67 0 ▶ { no strict 'refs'; *$method = $code }
Subroutine BEGIN: called CC=1 SCAR=0.6
68 0 $code->(@_)
69 }
70 }
71  
72 6 1;
73  
74 __END__
« AMQP/RPC/Client.pm ↑ Summary AMQP/Server/Protocol.pm »