« lib/POE/Component/MessageQueue/Storage/Double.pm
↑ Summary
lib/POE/Component/MessageQueue/Storage/Throttled.pm »
| 1 | # | ||||||||||||||||||||||||||||
| 2 | # Copyright 2007-2010 David Snopek <dsnopek@gmail.com> | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | # This program is free software: you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 5 | # it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||
| 6 | # the Free Software Foundation, either version 2 of the License, or | ||||||||||||||||||||||||||||
| 7 | # (at your option) any later version. | ||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||
| 9 | # This program is distributed in the hope that it will be useful, | ||||||||||||||||||||||||||||
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||||||||||||||||||||
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||||||||||||||||||||
| 12 | # GNU General Public License for more details. | ||||||||||||||||||||||||||||
| 13 | # | ||||||||||||||||||||||||||||
| 14 | # You should have received a copy of the GNU General Public License | ||||||||||||||||||||||||||||
| 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||||||||||||||||||
| 16 | # | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | package POE::Component::MessageQueue::Subscription; | ||||||||||||||||||||||||||||
| 19 | 19 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 19 | has client => ( | |||||||||||||||||||||||||||
| 22 | is => 'ro', | ||||||||||||||||||||||||||||
| 23 | isa => 'POE::Component::MessageQueue::Client', | ||||||||||||||||||||||||||||
| 24 | weak_ref => 1, | ||||||||||||||||||||||||||||
| 25 | required => 1, | ||||||||||||||||||||||||||||
| 26 | ); | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 19 | has destination => ( | |||||||||||||||||||||||||||
| 29 | is => 'ro', | ||||||||||||||||||||||||||||
| 30 | does => 'POE::Component::MessageQueue::Destination', | ||||||||||||||||||||||||||||
| 31 | weak_ref => 1, | ||||||||||||||||||||||||||||
| 32 | required => 1, | ||||||||||||||||||||||||||||
| 33 | ); | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 19 | has client_ack => ( | |||||||||||||||||||||||||||
| 36 | is => 'ro', | ||||||||||||||||||||||||||||
| 37 | default => 0, | ||||||||||||||||||||||||||||
| 38 | ); | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 19 | has ready => ( | |||||||||||||||||||||||||||
| 41 | is => 'rw', | ||||||||||||||||||||||||||||
| 42 | default => 1, | ||||||||||||||||||||||||||||
| 43 | ); | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | # Ready will always return true if client_ack is false. | ||||||||||||||||||||||||||||
| 46 | around ready => sub { | ||||||||||||||||||||||||||||
| 47 | 583 | ▶ | my $original = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 48 | 583 | my $self = shift; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 583 | ▶ | return $original->($self, @_) if (@_ || $self->client_ack); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@_ or $self->client_ack
MC/DC100%2/2
@_ or $self->client_ack
@_
$self->client_ack
Truth table100%3/3
A or B
A= @_B= $self->client_ack
| |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 33 | return 1; | |||||||||||||||||||||||||||
| 53 | 19 | }; | |||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 19 | __PACKAGE__->meta->make_immutable(); | |||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 19 | 1; | |||||||||||||||||||||||||||