File Coverage

blib/lib/Couchbase/Client/Async.pm
Criterion Covered Total %
statement 18 34 52.9
branch 0 4 0.0
condition 0 9 0.0
subroutine 6 8 75.0
pod 0 1 0.0
total 24 56 42.8


line stmt bran cond sub pod time code
1             package Couchbase::Client::Async;
2 3     3   14352 use strict;
  3         7  
  3         111  
3 3     3   13 use warnings;
  3         6  
  3         130  
4             our $VERSION = '1.0.2';
5 3     3   16 use Couchbase::Client;
  3         6  
  3         69  
6 3     3   16 use Couchbase::Client::IDXConst;
  3         17  
  3         739  
7 3     3   1366 use Log::Fu;
  3         58085  
  3         30  
8              
9              
10             sub new {
11 0     0 0   my ($cls,$options) = @_;
12 0           my @async_keys = qw(
13             cb_update_event
14             cb_error
15             cb_waitdone
16             cb_update_timer
17             bless_events
18             );
19 0           my %async_opts;
20 0           @async_opts{@async_keys} = delete @{$options}{@async_keys};
  0            
21              
22 0           my $arglist = Couchbase::Client::_MkCtorIDX($options);
23              
24 0 0 0       $arglist->[CTORIDX_CBEVMOD] = delete $async_opts{cb_update_event}
      0        
      0        
25             and
26             $arglist->[CTORIDX_CBERR] = delete $async_opts{cb_error}
27             and
28             $arglist->[CTORIDX_CBWAITDONE] = delete $async_opts{cb_waitdone}
29             and
30             $arglist->[CTORIDX_CBTIMERMOD] = delete $async_opts{cb_update_timer}
31              
32             or die "We require update_event, error, and wait_done callbacks";
33              
34 0 0         if($async_opts{bless_events}) {
35 0           $arglist->[CTORIDX_BLESS_EVENT] = 1;
36             }
37              
38 0           my $o = $cls->construct($arglist);
39 0           return $o;
40             }
41              
42             #Establish proxy methods:
43              
44             foreach my $subname (qw(
45             enable_compress
46             compression_settings
47             serialization_settings
48             conversion_settings
49             deconversion_settings
50             compress_threshold
51             timeout
52             )) {
53 3     3   1868 no strict 'refs';
  3         8  
  3         305  
54             *{$subname} = sub {
55 0     0     my ($self,@args) = @_;
56 0           my $base = $self->_get_base_rv;
57              
58 0           @_ = ($base, @args);
59 0           goto &{"Couchbase::Client::$subname"};
  0            
60             };
61             }
62              
63             1;
64              
65             __END__