A data queue is a powerful program-to-program interface. Programmers
who are familiar with programming on the iSeries™ servers are accustomed to using
queues. Data queues simply represent a method that is used to pass information
to another program.
Because this interface does not require communications programming, use
it either for synchronous or for asynchronous (disconnected) processing.
Develop host applications and PC applications by using any supported language.
For example, a host application could use RPG while a PC application might
use C++. The queue is there to obtain input from one side and to pass input
to the other.
The following example shows how data queues might be used:
- A PC user might take telephone orders all day, and key each order into
a program, while the program places each request on iSeries data queue.
- A partner program (either a PC program or an iSeries program) monitors the data queue
and pulls information from queue. This partner program could be simultaneously
running, or started after peak user hours.
- It may or may not return input to the initiating PC program, or it may
place something on the queue for another PC or iSeries program.
- Eventually the order is filled, the customer is billed, the inventory
records are updated, and information is placed on the queue for the PC application
to direct a PC user to call the customer with an expected ship date.
Objects
An application that uses the data queue
function uses four objects. Each of these objects is identified to
the application through a handle. The objects are:
- Queue object:
- This object represents the iSeries data queue.
- Attribute:
- This object describes the iSeries data queue.
- Data:
- Use these objects to write records to, and to read records from, the iSeries data
queue.
- Read object:
- Use this object only with the asynchronous read APIs. It uniquely identifies
a request to read a record from the iSeries data queue. This handle is used
on subsequent calls to check if the data has been returned. See the cwbDQ_AsyncRead API
for more information.