| 1 | package Qless::Queues; | ||||||||||
| 2 | =head1 NAME | ||||||||||
| 3 | |||||||||||
| 4 | Qless::Queues | ||||||||||
| 5 | |||||||||||
| 6 | =cut | ||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use Qless::Queue; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | ▶ | use JSON::XS qw(decode_json); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | ▶ | use Time::HiRes qw(); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | ▶ | use Qless::Utils qw(fix_empty_array); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 15 | 0 | my $class = shift; | |||||||||
| 16 | 0 | my ($client) = @_; | |||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | $class = ref $class if ref $class; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 0 | my $self = bless {}, $class; | |||||||||
| 20 | |||||||||||
| 21 | 0 | $self->{'client'} = $client; | |||||||||
| 22 | |||||||||||
| 23 | 0 | $self; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 0 | ▶ | sub counts { | ||||||||
|
Subroutine
counts: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 27 | 0 | my ($self) = @_; | |||||||||
| 28 | 0 | my $results = decode_json($self->{'client'}->_queues([], Time::HiRes::time)); | |||||||||
| 29 | 0 | $results = fix_empty_array($results); | |||||||||
| 30 | 0 | return $results; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub item { | ||||||||
|
Subroutine
item: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 34 | 0 | my ($self, $name) = @_; | |||||||||
| 35 | 0 | return Qless::Queue->new($name, $self->{'client'}, $self->{'client'}->{'worker_name'}); | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 1 | 1; | |||||||||