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