Queue Manager Manual

Queue Manager Application Example
Queue Management
1-8 46517 Tandem Computers Incorporated
The example in Step 3 assumes that there would typically not be an entry in the queue
for Process B. If the application expects an entry to be waiting in the queue for Process
B, it should issue the DEQ request before issuing the WAITQ request, as shown in the
following example.
BEGIN-TRANSACTION
SEND a DEQ UOW to the Entry Manager.
If the queue contains an entry of the
desired type, process the queue
entry and END-TRANSACTION
and look for more entries.
ELSE
END-TRANSACTION and
SEND a WAITQ to the Wait Manager.
009
The program is in a loop dequeuing entries (DEQ), entering the WAITQ loop only
when the DEQ loop runs out of entries to process.
READQ can be used to check for entries on a queue without dequeuing the entries.
Typically, READQ is used to read queue entries for purposes of creating statistics for a
status report.
Queue Manager
Application Example
One of the best applications of Queue Manager is as a buffer between requesters and
servers. The Queue function is especially useful in situations where a flood of requests
could create a bottleneck, forcing requesters to wait, idle, until the server can respond.
Queue Manager can also be used to enable an application to guide a given work entry
smoothly through a chain of processes. Each of the requesters or servers records some
information about the entry and performs some processing on it before handing it on.
The retailing application illustrated in Figure 1-4 is configured to perform such
functions without a Queue Manager. The application supports sale, inventory control,
and accounts payable functions associated with the sale of a single item. As each task
related to the sale is completed, the process involved passes the transaction
information on to the next server. The sales order process sends the sales transaction
to inventory control for a check of available supplies of the product. Inventory control
performs necessary processing to reserve the in-stock item and sends a purchase order
(PO) to purchasing so that replacement stock can be procured. Purchasing does the
necessary paperwork and forwards an invoice to accounts payable, which sends a
check to the vendor.