Queue Manager Manual

Using Queue Manager
Queue Management
1-4 46517 Tandem Computers Incorporated
Wait (WAITQ) Function A wait function is handled by a WAITQ request from a requester process. You should
not issue a WAITQ request within a TMF transaction, because the wait might be
extensive and it is best to avoid long transactions.
When a WAITQ request is received for a particular queue, the Wait Manager performs
a read to ensure there is no entry on that queue. If an entry is on the queue, the Wait
Manager issues a response to the consumer.
If the queue is empty, the Wait Manager waits for an entry to be added.
The application logic for addressing a queue that typically has entries should be
different from application logic for a queue that normally is empty. If you expect a
queue to be empty most of the time, send a WAITQ request before sending a DEQ
request. If you expect a queue to have entries, send a DEQ request first, and then
change to a WAITQ request when no more entries are found.
Using
Queue Manager
Figure 1-3 illustrates the submission of DEQ, ENQ, and READQ UOWs to the Entry
Manager and the submission of a WAITQ UOW to the Wait Manager.
Process A enqueues an entry to the Entry Manager, which acknowledges receipt of the
entry and passes it to the Queue File. Process A also sends the Entry Manager a
request to read an entry on the Queue File. The Entry Manager accepts this READQ
UOW and returns the information from the Queue File. Process B sends a DEQ UOW
to the Entry Manager to dequeue an entry from the Queue File. The Entry Manager
gets the entry from the Queue File, sending it to Process B in a response. Process B
also sends a WAITQ UOW to the Wait Manager. The Wait Manager waits for the
expected entry to appear on the Queue File, then notifies Process B in a response to the
original WAITQ UOW.