RabbitFoot/Channel.pm

filter: Statementstmt 67.4% 29 / 43 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 61.5% 8 / 13 Podpod 0.0% 0 / 1 totaltotal 62.7% 37 / 59 CC 4 SCAR 8.6
CC
4
Cov
64%
__ANON__
5.1
BEGIN
4.4
__ANON__
2.0
CRAP 2.4
« RabbitFoot/Cmd/Command/declare_exchange.pm ↑ Summary RabbitFoot.pm »
1 package Net::RabbitFoot::Channel;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Coro;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Coro::AnyEvent;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use AnyEvent::RabbitMQ::Channel;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 our $VERSION = '1.03';
12  
13 1 ▶BEGIN {
Subroutine BEGIN: called CC=3 SCAR=14.8
14 1 for my $method (qw(
15 close
16 declare_exchange delete_exchange
17 declare_queue bind_queue unbind_queue purge_queue delete_queue
18 consume cancel get qos
19 select_tx commit_tx rollback_tx
20 )) {
21 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
22 15 ▶ *{__PACKAGE__ . '::' . $method} = sub {
Subroutine __ANON__: not called CC=2 SCAR=16.3
23 0 my $self = shift;
24 0 my %args = @_;
25  
26 0 my $cb = Coro::rouse_cb;
27 0 ▶ $args{on_success} = sub {$cb->(1, @_);},
Subroutine __ANON__: not called CC=1 SCAR=6.9
28 0 ▶ $args{on_failure} = sub {$cb->(0, @_);},
Subroutine __ANON__: not called CC=1 SCAR=6.9
29  
30 0 $self->{arc}->$method(%args);
31 0 my ($is_success, @responses) = Coro::rouse_wait;
32 0 ▶ die @responses if !$is_success;
Branch: 1 branch
BranchTrueFalseTotal
unless $is_success 0 0 0
33 0 return $responses[0];
34 15 };
35 }
36  
37 1 for my $method (qw(publish ack recover reject)) {
38 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
39 4 ▶ *{__PACKAGE__ . '::' . $method} = sub {
Subroutine __ANON__: not called CC=1 SCAR=3.5
40 0 my $self = shift;
41 0 $self->{arc}->$method(@_);
42 0 return $self;
43 4 };
44 }
45 }
46  
47 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
48 0 my $class = shift;
49 0 return bless {
50 @_, # arc
51 }, $class;
52 }
53  
54 1 1;
« RabbitFoot/Cmd/Command/declare_exchange.pm ↑ Summary RabbitFoot.pm »