Client/server communication paradigms
In this section, we will discuss client/server communication paradigms. There are four different ways these communications can take place, namely request/reply, conversational, communication by using a queue, and event-based. There is a single namespace for all the service names, so from an administrative point of view, a service name can be defined as either request/response or conversational. A request/reply service can be called using tpcall()
, tpacall()
, or tpforward()
; tpconnect()
can only be used to call a conversational service.
Request/reply
This works in the following ways:
First it receives one request at a time and handles one request at a time.
Then it returns (using
tpreturn()
) or forwards (usingtpforward()
) the result.Tip
Using
tpforward()
to invoke a service in the same server works, but it is not considered a best practice as it defeats the purpose of usingtpforward()
to free up the server to process more requests.
Conversational
A service...