| 1 | package Net::Async::Redis::Subscription::Message; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 15 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 15 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 15 | our $VERSION = '6.006'; # VERSION | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | =head1 NAME | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | Net::Async::Redis::Subscription::Message - represents a single message | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | Instances are automatically generated by L<Net::Async::Redis>. | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | =cut | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 15 | ▶ | use Scalar::Util qw(weaken); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 21 | 0 | my ($class, %args) = @_; | |||||||||||||||||||||||||||
| 22 | 0 | ▶ | weaken($args{redis} // die 'Must be provided a Net::Async::Redis instance'); | ||||||||||||||||||||||||||
|
Condition0%0/2
$args{"redis"} // die("Must be provided a Net::Async::Redis instance")
MC/DC0%0/1
$args{"redis"} // die("Must be provided a Net::Async::Redis instance")
$args{"redis"}
Truth table0%0/2
A
A= $args{"redis"}
| |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | weaken($args{subscription} // die 'Must be provided a Net::Async::Redis::Subscription instance'); | ||||||||||||||||||||||||||
|
Condition0%0/2
$args{"subscription"} // die("Must be provided a Net::Async::Redis::Subscription instance")
MC/DC0%0/1
$args{"subscription"} // die("Must be provided a Net::Async::Redis::Subscription instance")
$args{"subscription"}
Truth table0%0/2
A
A= $args{"subscription"}
| |||||||||||||||||||||||||||||
| 24 | 0 | bless \%args, $class; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | =head2 redis | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | Accessor for the L<Net::Async::Redis> connection. | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | =cut | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub redis { shift->{redis} } | ||||||||||||||||||||||||||
|
Subroutine
redis: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | =head2 subscription | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | Accessor for the owning L<Net::Async::Redis::Subscription>. | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | =cut | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 0 | ▶ | sub subscription { shift->{subscription} } | ||||||||||||||||||||||||||
|
Subroutine
subscription: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | =head2 channel | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | Accessor for the channel name. | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | =cut | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | sub channel { shift->{channel} } | ||||||||||||||||||||||||||
|
Subroutine
channel: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | =head2 type | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | Type of this message - either C<pmessage> or C<message>. | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | =cut | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 0 | ▶ | sub type { shift->{type} } | ||||||||||||||||||||||||||
|
Subroutine
type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | =head2 payload | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | Message content (binary string). | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | =cut | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 0 | ▶ | sub payload { shift->{payload} } | ||||||||||||||||||||||||||
|
Subroutine
payload: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | 0 | ▶ | sub DESTROY { | ||||||||||||||||||||||||||
|
Subroutine
DESTROY: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||
| 68 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 69 | 0 | ▶ | return if ${^GLOBAL_PHASE} eq 'DESTRUCT' or not my $ev = $self->{events}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
${^GLOBAL_PHASE} eq "DESTRUCT" or not my $ev = $$self{"events"}
MC/DC0%0/2
${^GLOBAL_PHASE} eq "DESTRUCT" or not my $ev = $$self{"events"}
${^GLOBAL_PHASE} eq "DESTRUCT"
not my $ev = $$self{"events"}
Truth table0%0/3
A or not(B)
A= ${^GLOBAL_PHASE} eq "DESTRUCT"B= not my $ev = $$self{"events"}
| |||||||||||||||||||||||||||||
| 70 | 0 | ▶ | $ev->completion->done unless $ev->completion->is_ready; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | 15 | 1; | |||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | __END__ | ||||||||||||||||||||||||||||