Understanding server lifetime
Once we create our server object, we give full control to the Tuxedo runtime by calling the run
function. Tuxedo then does its magic and invokes the appropriate function for the service called by the client. In addition to services, these are the several functions that Tuxedo attempts to call during the server's lifetime:
tpsvrinit
: This is called during server startup and receives all command-line arguments. The arguments part is not very interesting for Python code because we can always get it fromsys.argv
, but it is present to match the C XATMI function with the same name. What you do in this function depends on your application, but it must return0
to indicate success and-1
for error. A typical task in this function for Tuxedo servers is to advertise services.tpsvrdone
: This is called during server shutdown and typically cleans up connections and other resources.tpsvrthrinit
: This is similar totpsvrinit
, but is used for multithreaded...