File Coverage

blib/lib/Thrift/XS/CompactProtocol.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package Thrift::XS::CompactProtocol;
2              
3 4     4   26 use strict;
  4         8  
  4         152  
4 4     4   18 use base('Thrift::XS::BinaryProtocol');
  4         18  
  4         466  
5 4     4   1964 use Thrift::MessageType;
  4         2390  
  4         126  
6              
7 4     4   26 use Thrift::XS;
  4         8  
  4         117  
8              
9             # Implementation is in CompactProtocol.xs
10              
11             1;
12             __END__
13              
14             =head1 NAME
15              
16             Thrift::XS::CompactProtocol - More efficient binary protocol
17              
18             =head1 SYNOPSIS
19              
20             use Thrift;
21             use Thrift::Socket;
22             use Thrift::FramedTransport;
23             use Thrift::XS::CompactProtocol;
24             use MyThriftInterface;
25            
26             my $socket = Thrift::Socket->new( $host, $port );
27             my $transport = Thrift::FramedTransport->new($socket);
28             my $protocol = Thrift::XS::CompactProtocol->new($transport);
29             my $client = MyThriftInterface->new($protocol);
30            
31             $transport->open;
32            
33             $client->api_call( @args );
34              
35             =head1 DESCRIPTION
36              
37             As the name implies, this is a more compact and efficient binary protocol.
38              
39             =head1 AUTHOR
40              
41             Andy Grundman, E<lt>andy@slimdevices.comE<gt>
42              
43             =head1 COPYRIGHT AND LICENSE
44              
45             Copyright 2011 Logitech, Inc.
46              
47             Licensed under the Apache License, Version 2.0 (the "License");
48             you may not use this file except in compliance with the License.
49             You may obtain a copy of the License at
50              
51             http://www.apache.org/licenses/LICENSE-2.0
52              
53             Unless required by applicable law or agreed to in writing, software
54             distributed under the License is distributed on an "AS IS" BASIS,
55             WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
56             See the License for the specific language governing permissions and
57             limitations under the License.
58              
59             =cut