| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Message::Passing::AMQP::Role::BindsAQueue; |
|
2
|
1
|
|
|
1
|
|
534
|
use Moo::Role; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
6
|
|
|
3
|
1
|
|
|
1
|
|
428
|
use Types::Standard qw( Str HashRef ); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
7
|
|
|
4
|
1
|
|
|
1
|
|
672
|
use Scalar::Util qw/ weaken /; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
57
|
|
|
5
|
1
|
|
|
1
|
|
7
|
use namespace::autoclean; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
6
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
with qw/ |
|
8
|
|
|
|
|
|
|
Message::Passing::AMQP::Role::DeclaresExchange |
|
9
|
|
|
|
|
|
|
Message::Passing::AMQP::Role::DeclaresQueue |
|
10
|
|
|
|
|
|
|
/; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has bind_routing_key => ( |
|
13
|
|
|
|
|
|
|
isa => Str, |
|
14
|
|
|
|
|
|
|
is => 'ro', |
|
15
|
|
|
|
|
|
|
default => '#', |
|
16
|
|
|
|
|
|
|
); |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has bind_arguments => ( |
|
19
|
|
|
|
|
|
|
isa => HashRef, |
|
20
|
|
|
|
|
|
|
is => 'ro', |
|
21
|
|
|
|
|
|
|
); |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
after [qw[_set_queue ]] => sub { |
|
24
|
|
|
|
|
|
|
my $self = shift; |
|
25
|
|
|
|
|
|
|
if ($self->_has_exchange && $self->_has_queue) { |
|
26
|
|
|
|
|
|
|
weaken($self); |
|
27
|
|
|
|
|
|
|
$self->_channel->bind_queue( |
|
28
|
|
|
|
|
|
|
queue => $self->queue_name, |
|
29
|
|
|
|
|
|
|
exchange => $self->exchange_name, |
|
30
|
|
|
|
|
|
|
routing_key => $self->bind_routing_key, |
|
31
|
|
|
|
|
|
|
arguments => $self->bind_arguments, |
|
32
|
|
|
|
|
|
|
on_success => sub { |
|
33
|
|
|
|
|
|
|
#warn("Bound queue"); |
|
34
|
|
|
|
|
|
|
}, |
|
35
|
|
|
|
|
|
|
on_failure => sub { |
|
36
|
|
|
|
|
|
|
warn("Failed to bind queue"); |
|
37
|
|
|
|
|
|
|
}, |
|
38
|
|
|
|
|
|
|
); |
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
}; |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Message::Passing::AMQP::Role::BindsAQueue |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Role for components which cause a single queue to be bound to a single exchange with a single routing key. |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 bind_arguments |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Gets passed to L<Message::Passing::AMQP::ConnectionManager>, defaults to false. |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 bind_routing_key |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Defaults to C<#>, which matches any routing key. |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 CONSUMES |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=over |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=item L<Message::Passing::AMQP::Role::BindsQueues> |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=item L<Message::Passing::AMQP::Role::DeclaresExchange> |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=item L<Message::Passing::AMQP::Role::DeclaresQueue> |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=back |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |