This presentation is about the key challenges of cross language interactions and how they can be overcome. We discuss the Apache Thrift as a solution and understand its principle of Operation with code snippets and examples.
15. Principle Of Operation Thrift Code Generator Tool (written in C++) Create a thrift file eg demo.thrift Define Data types and Service interfaces Build Thrift platform files Demo.php Demo.java Demo.py Demo.cpp Create Server/Client App Run the Server Server implements Services and Client calls them
16.
17.
18.
19.
20.
21.
22.
23.
24.
25. The Thrift Stack Object write() TTransport TProtocol TTransport TProtocol Object read() Information Flow!
26.
27.
28.
29.
30.
31.
32.
33. Some Real Time Example PHP based Web App Thrift PHP Lib Search Service (implemented in C++
34.
35.
36.
Notes de l'éditeur
First of all, in *.thrift file you declare objects and procedures, that you would like to interchange between applications written in different languages. Then, using thrift tool, you build Thrift platform files for programming languages of your choice. Most important step is to create server and client applications, using code generated in the previous step. Server application should implement procedures declared in the thrift file, while client should call them. Thrift itself takes care about creating transport classes, defining objects, etc. so your responsibility is only to use them in your code. Last, but not least :) is to run your server. Then, using client script, you can perform actions using previously defined objects and methods.