File Coverage

blib/lib/Eixo/Queue/Mongo.pm
Criterion Covered Total %
statement 9 12 75.0
branch 0 2 0.0
condition n/a
subroutine 3 6 50.0
pod 0 3 0.0
total 12 23 52.1


line stmt bran cond sub pod time code
1             package Eixo::Queue::Mongo;
2              
3 1     1   870 use strict;
  1         1  
  1         26  
4              
5 1     1   3 use Eixo::Base::Clase qw(Eixo::Queue);
  1         1  
  1         6  
6 1     1   45 use Eixo::Queue::MongoDriver;
  1         0  
  1         5  
7              
8             has(
9              
10             mongo_driver=>undef,
11              
12             db=>undef,
13              
14             collection => undef,
15              
16             host=>undef,
17              
18             port=>undef,
19              
20             );
21              
22             sub init{
23              
24 0 0   0 0   $_[0]->mongo_driver(
25              
26             Eixo::Queue::MongoDriver->new(
27              
28             db=>$_[0]->db,
29              
30             host=>$_[0]->host,
31              
32             port=>$_[0]->port,
33              
34             collection=>$_[0]->collection
35              
36             )
37              
38             ) unless($_[0]->mongo_driver);
39              
40             }
41              
42             sub add{
43              
44 0     0 0   $_[0]->mongo_driver->addJob($_[1]);
45             }
46              
47             sub status{
48              
49 0     0 0   $_[0]->mongo_driver->getJob(@_[1..$#_]);
50              
51             }
52              
53              
54             1;