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