Typical use of data queues

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:

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.