| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package AnyEvent::RabbitMQ::Fork::Channel; |
|
2
|
|
|
|
|
|
|
$AnyEvent::RabbitMQ::Fork::Channel::VERSION = '0.4'; |
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
AnyEvent::RabbitMQ::Fork::Channel - Facade over L |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $ch = $rf->open_channel; |
|
10
|
|
|
|
|
|
|
$ch->declare_exchange(exchange => 'test_exchange'); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
|
13
|
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
7905
|
use Moo; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
10
|
|
|
15
|
1
|
|
|
1
|
|
496
|
use Types::Standard qw(Int Object Bool); |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
15
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
2943
|
use namespace::clean; |
|
|
1
|
|
|
|
|
29892
|
|
|
|
1
|
|
|
|
|
7
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
This module provides an API to L that is running in |
|
22
|
|
|
|
|
|
|
a fork maintained by L. Note that this is a facade |
|
23
|
|
|
|
|
|
|
and not a subclass. It does however attempt to honor the public interface of |
|
24
|
|
|
|
|
|
|
the real thing. |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
There are some undocumented features of the real module that are not implemented |
|
27
|
|
|
|
|
|
|
here. I leave that as an excercise for the reader to discover. At such a time as |
|
28
|
|
|
|
|
|
|
those features appear to become formalized, I will expose them here. |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=over |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=item B Numerical ID assigned by the connection object and used in |
|
35
|
|
|
|
|
|
|
coordination with the server. |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=item B Indicator if this channel is open for use. |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item B Indicator if the server has sent a C frame as |
|
40
|
|
|
|
|
|
|
a form of throttle control. Will be true if that is the case. |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item B Indicator if the channel is in confirm mode, meaning the |
|
43
|
|
|
|
|
|
|
server will Ack/Nack/Return every message published. |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=back |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
has id => (is => 'ro', isa => Int); |
|
50
|
|
|
|
|
|
|
has is_open => (is => 'ro', isa => Bool, default => 0); |
|
51
|
|
|
|
|
|
|
has is_active => (is => 'ro', isa => Bool, default => 0); |
|
52
|
|
|
|
|
|
|
has is_confirm => (is => 'ro', isa => Bool, default => 0); |
|
53
|
|
|
|
|
|
|
has connection => ( |
|
54
|
|
|
|
|
|
|
is => 'ro', |
|
55
|
|
|
|
|
|
|
isa => Object, |
|
56
|
|
|
|
|
|
|
weak_ref => 1, |
|
57
|
|
|
|
|
|
|
handles => { delegate => '_delegate' } |
|
58
|
|
|
|
|
|
|
); |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 METHODS |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Pretty well enumerated in L. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
my @methods = qw( |
|
67
|
|
|
|
|
|
|
open |
|
68
|
|
|
|
|
|
|
close |
|
69
|
|
|
|
|
|
|
declare_exchange |
|
70
|
|
|
|
|
|
|
delete_exchange |
|
71
|
|
|
|
|
|
|
declare_queue |
|
72
|
|
|
|
|
|
|
bind_queue |
|
73
|
|
|
|
|
|
|
unbind_queue |
|
74
|
|
|
|
|
|
|
purge_queue |
|
75
|
|
|
|
|
|
|
delete_queue |
|
76
|
|
|
|
|
|
|
publish |
|
77
|
|
|
|
|
|
|
consume |
|
78
|
|
|
|
|
|
|
cancel |
|
79
|
|
|
|
|
|
|
get |
|
80
|
|
|
|
|
|
|
ack |
|
81
|
|
|
|
|
|
|
qos |
|
82
|
|
|
|
|
|
|
confirm |
|
83
|
|
|
|
|
|
|
recover |
|
84
|
|
|
|
|
|
|
reject |
|
85
|
|
|
|
|
|
|
select_tx |
|
86
|
|
|
|
|
|
|
commit_tx |
|
87
|
|
|
|
|
|
|
rollback_tx |
|
88
|
|
|
|
|
|
|
); |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
foreach my $method (@methods) { |
|
91
|
1
|
|
|
1
|
|
486
|
no strict 'refs'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
119
|
|
|
92
|
|
|
|
|
|
|
*$method = sub { |
|
93
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
94
|
0
|
|
|
|
|
|
$self->delegate($method => $self->id, @_); |
|
95
|
0
|
|
|
|
|
|
return $self; |
|
96
|
|
|
|
|
|
|
}; |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 AUTHOR |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
William Cox |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Copyright (c) 2014, the above named author(s). |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 LICENSE |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
1; |