line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
765
|
use 5.008001; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
40
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
70
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Dancer::Plugin::Queue::Array; |
6
|
|
|
|
|
|
|
# ABSTRACT: No abstract given for Dancer::Plugin::Queue::Array |
7
|
|
|
|
|
|
|
our $VERSION = '0.002'; # VERSION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Dependencies |
10
|
1
|
|
|
1
|
|
3417
|
use Moo; |
|
1
|
|
|
|
|
16422
|
|
|
1
|
|
|
|
|
6
|
|
11
|
|
|
|
|
|
|
with 'Dancer::Plugin::Queue::Role::Queue'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has name => ( |
15
|
|
|
|
|
|
|
is => 'ro', |
16
|
|
|
|
|
|
|
required => 1, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has _messages => ( |
20
|
|
|
|
|
|
|
is => 'ro', |
21
|
|
|
|
|
|
|
default => sub { [] }, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub add_msg { |
26
|
1
|
|
|
1
|
1
|
839
|
my ( $self, $msg ) = @_; |
27
|
1
|
|
|
|
|
2
|
push @{ $self->_messages }, $msg; |
|
1
|
|
|
|
|
6
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub get_msg { |
32
|
1
|
|
|
1
|
1
|
1
|
my ($self) = @_; |
33
|
1
|
|
|
|
|
5
|
my $msg = shift @{ $self->_messages }; |
|
1
|
|
|
|
|
5
|
|
34
|
1
|
50
|
|
|
|
5
|
return wantarray ? ( $msg, $msg ) : $msg; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub remove_msg { |
39
|
1
|
|
|
1
|
1
|
4
|
my ( $self, $msg ) = @_; |
40
|
|
|
|
|
|
|
# XXX NOOP since 'get_msg' already removes it |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# vim: ts=4 sts=4 sw=4 et: |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |