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 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 makes a request and won't wait for the result of the log
method. This method doesn't provide any return value, which is marked by the void
keyword (note that all oneway
methods should return void
). You may also notice numbered argument notation...