File Coverage

blib/lib/DBD/Gofer/Transport/null.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition 2 2 100.0
subroutine 6 6 100.0
pod 0 2 0.0
total 30 32 93.7


line stmt bran cond sub pod time code
1             package DBD::Gofer::Transport::null;
2              
3             # $Id: null.pm 10087 2007-10-16 12:42:37Z Tim $
4             #
5             # Copyright (c) 2007, Tim Bunce, Ireland
6             #
7             # You may distribute under the terms of either the GNU General Public
8             # License or the Artistic License, as specified in the Perl README file.
9              
10 52     52   209 use strict;
  52         67  
  52         1623  
11 52     52   238 use warnings;
  52         116  
  52         1374  
12              
13 52     52   231 use base qw(DBD::Gofer::Transport::Base);
  52         118  
  52         21343  
14              
15 52     52   25898 use DBI::Gofer::Execute;
  52         139  
  52         8443  
16              
17             our $VERSION = "0.010088";
18              
19             __PACKAGE__->mk_accessors(qw(
20             pending_response
21             transmit_count
22             ));
23              
24             my $executor = DBI::Gofer::Execute->new();
25              
26              
27             sub transmit_request_by_transport {
28 4904     4904 0 5507 my ($self, $request) = @_;
29 4904   100     11319 $self->transmit_count( ($self->transmit_count()||0) + 1 ); # just for tests
30              
31 4904         12051 my $frozen_request = $self->freeze_request($request);
32              
33             # ...
34             # the request is magically transported over to ... ourselves
35             # ...
36              
37 4904         11828 my $response = $executor->execute_request( $self->thaw_request($frozen_request, undef, 1) );
38              
39             # put response 'on the shelf' ready for receive_response()
40 4904         32465 $self->pending_response( $response );
41              
42 4904         74052 return undef;
43             }
44              
45              
46             sub receive_response_by_transport {
47 4907     4907 0 5363 my $self = shift;
48              
49 4907         9041 my $response = $self->pending_response;
50              
51 4907         11938 my $frozen_response = $self->freeze_response($response, undef, 1);
52              
53             # ...
54             # the response is magically transported back to ... ourselves
55             # ...
56              
57 4907         13105 return $self->thaw_response($frozen_response);
58             }
59              
60              
61             1;
62             __END__