Developer(s) | Apache Software Foundation |
---|---|
Stable release | |
Repository | Thrift Repository |
Written in | ActionScript, C, C#, C++, D, Dart, Delphi, Erlang, Go, Haskel, Haxe, Java, JavaScript, Node.js, OCaml, Perl, PHP, Python, Rust, SmallTalk |
Type | Remote procedure call framework |
License | Apache License 2.0 |
Website | thrift.apache.org |
ByteArrayOutputStream
internally.ArrayList<String>
. C++ uses std::vector<std::string>
.PhoneType
will be a simple enum
inside the Phone
class.Thrift is a separate Apache project which is a binary communication protocol
Through a simple and straightforward Interface Definition Language (IDL), Thrift allows [users] to define and create services which are both consumable by and serviceable by numerous languages. Using code generation, Thrift creates a set of files which can then be used for creating clients and/or servers. In addition to interoperability, Thrift can be very efficient through a unique serialization mechanism that is efficient in both time and space.
Thrift supports many languages too varying degrees. The complete list is below. Be careful before assuming that just because your language has some support that it supports all of Thrift's features. Python for example, only supports TBinaryProtocol. Cocoa, C++, C#, Erlang, Haskell, Java, OCaml, Perl, PHP, Python, Ruby, and Smalltalk
The top portion of the stack is generated code from your Thrift definition file. Thrift services result in generated client and processor code. These are represented by the brown boxes in the diagram. The data structures that are sent (other than built-in types) also result in generated code. These result in the red boxes. The protocol and transport are part of the Thrift runtime library. Therefore with Thrift, you can define a service, and are free to change the protocol and transport without re-generating your code. Thrift also includes a server infrastructure to tie the protocols and transports together. There are blocking, non-blocking, single and multi-threaded servers available. The 'Underlying I/O' portion of the stack differs based on the language in question. For Java and Python network I/O, the built-in libraries are leveraged by the Thrift library, while the C++ implementation uses its own custom implementation.
Branch | Travis | Appveyor | Coverity Scan | codecov.io | Website |
---|---|---|---|---|---|
master | |||||
0.12.0 |