TRANSFER Programming Manual
10 Designing and Writing an Agent
069138, Update 1 to 040970 Tandem Computers Incorporated 10–1
A TRANSFER application frequently includes one or more agents. The TRANSFER
delivery system optionally notifies these agents when the TRANSFER system delivers
a package to a recipient's depot, and the agent generally takes some kind of action as a
result. Agent notification is handled by the TRANSFER asynchronous requester
(TAREQ) that delivers the package. In response, a particular agent can perform
additional processing related to the delivery such as filing the package for later
retrieval or replying to the sender of the package.
An agent eliminates the need for polling to see if packages have arrived. An agent also
allows the application to automatically process incoming packages without human
intervention.
The guidelines in Section 8, “Developing TRANSFER Applications,” and Section 9,
“Designing and Writing a Client,” also apply to agents.
When you design and write an agent, you will need to consider the following steps:
1. Decide what types of responsibilities your agent will have. Examples are listed in
Section 2, “TRANSFER Application Components.”
2. Select a programming language.
3. Code your agent so that it performs the required functions and communicates
with TAREQ
4. Configure the agent into a test TRANSFER environment.
5. Debug the agent.
This section describes each step. A sample agent is listed at the end of this section. In
addition, Section 11 contains an agent test program (as an example of a TRANSFER
program).
Precautions About
Using Agents
The use of agents can provide many advantages to your TRANSFER application. In
designing your application, however, you should consider the following:
The amount of time that the TRANSFER delivery system waits for agents can
severely impact the ability of the TAREQ to perform other tasks. The TAREQ
must wait for the agent to complete its activities and cannot provide other services
in the meantime. When the agent is a server rather than a SCREEN COBOL
requester, you can specify time limits that the TAREQ must wait on the agent
server class before aborting the transaction.
Multiple agents for a single recipient all operate within the same TMF transaction.
An agent required by a delivery is invoked only if that delivery is successful.