1Thrift Perl Software Library 2 3# Summary 4 5Apache Thrift is a software framework for scalable cross-language services development. 6It combines a software stack with a code generation engine to build services that work 7efficiently and seamlessly between many programming languages. A language-neutral IDL 8is used to generate functioning client libraries and server-side handling frameworks. 9 10# License 11 12Licensed to the Apache Software Foundation (ASF) under one 13or more contributor license agreements. See the NOTICE file 14distributed with this work for additional information 15regarding copyright ownership. The ASF licenses this file 16to you under the Apache License, Version 2.0 (the 17"License"); you may not use this file except in compliance 18with the License. You may obtain a copy of the License at 19 20 http://www.apache.org/licenses/LICENSE-2.0 21 22Unless required by applicable law or agreed to in writing, 23software distributed under the License is distributed on an 24"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 25KIND, either express or implied. See the License for the 26specific language governing permissions and limitations 27under the License. 28 29# For More Information 30 31See the [Apache Thrift Web Site](http://thrift.apache.org/) for more information. 32 33# Using Thrift with Perl 34 35Thrift requires Perl >= 5.10.0 36 37Unexpected exceptions in a service handler are converted to 38TApplicationException with type INTERNAL ERROR and the string 39of the exception is delivered as the message. 40 41On the client side, exceptions are thrown with die, so be sure 42to wrap eval{} statments around any code that contains exceptions. 43 44Please see tutoral and test dirs for examples. 45 46The Perl ForkingServer ignores SIGCHLD allowing the forks to be 47reaped by the operating system naturally when they exit. This means 48one cannot use a custom SIGCHLD handler in the consuming perl 49implementation that calls serve(). It is acceptable to use 50a custom SIGCHLD handler within a thrift handler implementation 51as the ForkingServer resets the forked child process to use 52default signal handling. 53 54# Dependencies 55 56The following modules are not provided by Perl 5.10.0 but are required 57to use Thrift. 58 59## Runtime 60 61 * Bit::Vector 62 * Class::Accessor 63 64### HttpClient Transport 65 66These are only required if using Thrift::HttpClient: 67 68 * HTTP::Request 69 * IO::String 70 * LWP::UserAgent 71 72### SSL/TLS 73 74These are only required if using Thrift::SSLSocket or Thrift::SSLServerSocket: 75 76 * IO::Socket::SSL 77 78# Breaking Changes 79 80## 0.10.0 81 82The socket classes were refactored in 0.10.0 so that there is one package per 83file. This means `use Socket;` no longer defines SSLSocket. You can use this 84technique to make your application run against 0.10.0 as well as earlier versions: 85 86`eval { require Thrift::SSLSocket; } or do { require Thrift::Socket; }` 87 88## 0.11.0 89 90 * Namespaces of packages that were not scoped within Thrift have been fixed. 91 ** TApplicationException is now Thrift::TApplicationException 92 ** TException is now Thrift::TException 93 ** TMessageType is now Thrift::TMessageType 94 ** TProtocolException is now Thrift::TProtocolException 95 ** TProtocolFactory is now Thrift::TProtocolFactory 96 ** TTransportException is now Thrift::TTransportException 97 ** TType is now Thrift::TType 98 99If you need a single version of your code to work with both older and newer thrift 100namespace changes, you can make the new, correct namespaces behave like the old ones 101in your files with this technique to create an alias, which will allow you code to 102run against either version of the perl runtime for thrift: 103 104`BEGIN {*TType:: = *Thrift::TType::}` 105 106 * Packages found in Thrift.pm were moved into the Thrift/ directory in separate files: 107 ** Thrift::TApplicationException is now in Thrift/Exception.pm 108 ** Thrift::TException is now in Thrift/Exception.pm 109 ** Thrift::TMessageType is now in Thrift/MessageType.pm 110 ** Thrift::TType is now in Thrift/Type.pm 111 112If you need to modify your code to work against both older or newer thrift versions, 113you can deal with these changes in a backwards compatible way in your projects using eval: 114 115`eval { require Thrift::Exception; require Thrift::MessageType; require Thrift::Type; } 116 or do { require Thrift; }` 117 118# Deprecations 119 120## 0.11.0 121 122Thrift::HttpClient setRecvTimeout() and setSendTimeout() are deprecated. 123Use setTimeout instead. 124 125