File Coverage

lib/DR/Tnt/Client/Coro.pm
Criterion Covered Total %
statement 18 26 69.2
branch 0 2 0.0
condition n/a
subroutine 6 8 75.0
pod 0 2 0.0
total 24 38 63.1


line stmt bran cond sub pod time code
1 2     2   169571 use utf8;
  2         22  
  2         12  
2 2     2   59 use strict;
  2         4  
  2         42  
3 2     2   10 use warnings;
  2         4  
  2         95  
4              
5             package DR::Tnt::Client::Coro;
6 2     2   13 use Carp;
  2         4  
  2         151  
7             $Carp::Internal{ (__PACKAGE__) }++;
8 2     2   1272 use Coro;
  2         19009  
  2         149  
9 2     2   943 use Mouse;
  2         59079  
  2         9  
10              
11 0     0 0   sub driver { 'async' }
12              
13             sub request {
14 0     0 0   my ($self, @args) = @_;
15              
16 0           my $cb = Coro::rouse_cb;
17            
18 0           my $m = $args[0];
19              
20 0 0         @args = ('select', @args[1, 2, 3], 1, 0, 'EQ') if $m eq 'get';
21              
22 0           $self->_fcb->request(@args, $cb);
23 0           my ($status, $message, $resp) = Coro::rouse_wait $cb;
24              
25 0           return $self->_response($m, $status, $message, $resp);
26             }
27              
28             with 'DR::Tnt::Client::Role::LikeSync';
29              
30             __PACKAGE__->meta->make_immutable;