Calling a service
The most common way of calling services is by using the tpcall
function, as we did before. In addition to service name and request data, there is a third argument named flags
. The possible values are as follows:
TPSIGRSTRT
means that any underlying system call that is interrupted by a signal will be retried. The short advice regarding signals is do not use them and you will not need the flag.TPNOBLOCK
instructs to call a service intry
tpcall
mode. If the request queue is full, the call will return immediately instead of waiting until there is plenty of space for the request. The call will return with an exception code,TPEBLOCK
.TPNOTIME
is slightly related to theTPNOBLOCK
flag. By default, thetpcall
function will wait for free space in the request queue until the blocking timeout occurs. UsingTPNOTIME
makes thetpcall
immune to this timeout at the risk of waiting for a long time. We will cover that in detail in Chapter 7, Distributed Transactions...