Analyzing the code

Before we go further, let's have a quick look and explain the most important parts of the code that we used in this chapter. We will dig deeper into the technical details and deal with many useful Apache Thrift options in Chapter 4, Understanding How Apache Thrift Works.

The service description – IDL

The most important part of the service description begins with the following line:

service MyFirstService {

In this block, there are descriptions of methods exposed by this service. Let's have a look at the first two:

oneway void log(1:string filename),
int multiply(1:int number1, 2:int number2),

The syntax bears a strong resemblance to C++'s (and other popular languages') method definitions. The oneway keyword means that the client only ...

Get Learning Apache Thrift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.