Use the RxQueue function in a REXX program to create and delete queues and to set and query their names. The first parameter determines the function, the entire function name must be specified but the case of the function parameter is ignored.
Syntax:
──RXQUEUE(─┬──"Create"──┬─────────────┬─┬─)───── │ └─,queuename ─┘ │ ├───"Delete"── queuename ────┤ ├───"Get"───── newqueuename ─┤ └───"Set"───── newqueuename ─┘
Parameters:
Create
Queue has been deleted.
Not a valid queue name.
Queue named does not exist.
10
Example: Sample Queue in a REXX Procedure
/* */ /* push/pull WITHOUT multiprogramming support */ /* */ push date() time() /* push date and time */ do 1000 /* lets pass some time */ nop /* doing nothing */ end /* end of loop */ pull a b . /* pull them */ say 'Pushed at ' a b ', Pulled at ' date() time() /* say now and then */ /* */ /* push/pull WITH multiprogramming support */ /* (no error recovery, or unsupported env tests */ /* */ newq = RXQUEUE('Create') /* create a unique queue */ oq = RXQUEUE('Set',newq) /* establish new queue */ push date() time() /* push date and time */ do 1000 /* lets spend some time */ nop /* doing nothing */ end /* end of loop */ pull a b . /* get pushed info */ say 'Pushed at ' a b ', Pulled at ' date() time() /* tell user */ call RXQUEUE 'Delete',newq /* destroy unique queue created */ call RXQUEUE 'Set',oq /* reset to default queue (not required)*/
Special Considerations
newqueue = RXQUEUE('Create', 'os2que')
a new queue is created and the name is chosen by REXX. This new name is returned by the function.
Detached Processes
Multi-Programming Considerations
This data queue mechanism differs from OS/2 standard API queueing in the following ways:
However, synchronization of requests such that two processes, accessing the same queue, get the data in the order it was placed on the queue is a user responsibility and will not be provided by the subsystem support code. This selector is owned by the calling application code and must be freed by the caller using DosFreeSeg.
Data queues must be explicitly deleted by some procedure or program (not necessarily the creator). Deletion of a queue with remaining items, destroys those items. If a queue is not deleted, it will be lost and cannot be recovered except by randomly attempting to access each queue in the defined series.