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