concept process in category apache thrift

appears as: processes, process, The process, process, The process
Programmer's Guide to Apache Thrift

This is an excerpt from Manning's book Programmer's Guide to Apache Thrift.

Serialization is a basic function in any cross-platform/language exchange. For example, imagine an application for the music industry that uses NATS as a messaging system to move song data between processes (see figure 1.2). Using NATS, the team can send/receive messages rapidly between their remote processes written in Java and Python. The question is, can the programs read the musical messages when sent by another language? Python objects are represented differently in memory than Java objects. If a Python program sent the raw memory bits for its music track data to a Java program, fireworks would ensue.

$ python hello_server.py
[Server] Started
[Server] Handling client request
ERROR:thrift.server.TProcessPoolServer:[Errno 104] Connection reset by peer
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/thrift/server/
   TProcessPoolServer.py", line 78, in serveClient
    self.processor.process(iprot, oprot)
  File "gen-py/hello_name/HelloSvc.py", line 78, in process
    (name, type, seqid) = iprot.readMessageBegin()
  File "/usr/local/lib/python2.7/dist-packages/thrift/protocol/
   TJSONProtocol.py", line 318, in readMessageBegin
    self.readJSONArrayStart()
  File "/usr/local/lib/python2.7/dist-packages/thrift/protocol/
   TJSONProtocol.py", line 306, in readJSONArrayStart
    self.readJSONSyntaxChar(LBRACKET)
  File "/usr/local/lib/python2.7/dist-packages/thrift/protocol/
   TJSONProtocol.py", line 211, in readJSONSyntaxChar
    current = self.reader.read()
  File "/usr/local/lib/python2.7/dist-packages/thrift/protocol/
   TJSONProtocol.py", line 140, in read
    self.data = self.protocol.trans.read(1)
  File "/usr/local/lib/python2.7/dist-packages/thrift/transport/
   TTransport.py", line 159, in read
    self.__rbuf = StringIO(self.__trans.read(max(sz, self.__rbuf_size)))
  File "/usr/local/lib/python2.7/dist-packages/thrift/transport/TSocket.py",
   line 105, in read
    buff = self.handle.recv(sz)
error: [Errno 104] Connection reset by peer


!@%STYLE%@!
{"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":0,\"ch\":2},{\"line\":0,\"ch\":24}]]"}
!@%STYLE%@!

The process of compiling a dependent IDL file is similar to compiling any other IDL file, as shown in the following session:

  • IDLs support the process of developing explicit mechanical contracts between clients and servers.