Data Queue Methods
CrtDataQGetSPLList
CrtDataQGetSPLList ($DataQName, $DataQLib, $MaxLength, $Sequence, $KeyLength, $Authority, $QSizeMaxNumEntries, $ QSizeInitNumEntries) - Creates a Data Queue object.
Arguments |
Value |
Description |
$DataQName |
|
Data Queue name |
$DataQLib |
|
Data Queue library name |
$MaxLength |
128 - default |
Data Queue length |
$Sequence |
|
Sequence type |
$KeyLength |
0 - default |
Key length Applicable if $Sequence=’*KEYED’ |
$Authority |
|
Data Queue object authority |
$QSizeMaxNumEntries |
|
Queue maximum number of entries |
$QSizeInitNumEntries |
16 - default |
Initial number of entries |
Sample Code
|
$DQ->CreateDataQ('TESTDQ', $test_lib, 200, '*KEYED', 15, '*CHANGE', 100, 20 ) |
|
CrtDataQ
CrtDataQ ($DataQName, $DataQLib, $MaxLength, $Sequence, $KeyLength, $Authority, $QSizeMaxNumEntries, $ QSizeInitNumEntries) - Creates a Data Queue object.
Arguments |
Value |
Description |
$DataQName |
|
Data Queue name |
$DataQLib |
|
Data Queue library name |
$MaxLength |
128 - default |
Data Queue length |
$Sequence |
|
Sequence type |
$KeyLength |
0 - default |
Key length Applicable if $Sequence=’*KEYED’ |
$Authority |
|
Data Queue object authority |
$QSizeMaxNumEntries |
|
Queue maximum number of entries |
$QSizeInitNumEntries |
16 - default |
Initial number of entries |
Sample Code
|
$DQ->CreateDataQ('TESTDQ', ‘TESTLIB’, 200, '*KEYED', 15, '*CHANGE', 100, 20 ) |
|
DeleteDQ
DeleteDQ ($DataQName, $DataQLib) - Delete a Data Queue object.
Arguments |
Value |
Description |
$DataQName |
|
Data Queue name |
$DataQLib |
|
Data Queue library name |
Sample Code
|
$DQ->DeleteDQ('TESTDQ', ‘TESTLIB’) |
|
ReceieveDataQueue
ReceieveDataQueue($WaitTime, $KeyOrder, $KeyLength , $KeyData ', $WithRemoveMsg ) - Write a message to a Data Queue.
Arguments |
Value |
Description |
$WaitTime |
|
The amount of time to wait if no entries exist on the Data Queue.
|
$KeyOrder |
|
The comparison criteria between the keys of messages on the Data Queue and the key data parameter. When the system searches for the requested key, the entries are searched in ascending order from the lowest value key to the highest value key until a match is found. If there are entries with duplicate keys, the entry that was put on the queue first is received. Valid values are:
This parameter is ignored if the length of key data is zero. A value of blanks is recommended if the length of key data is zero. |
$KeyLength |
|
The length of the key data parameter. If this parameter is specified, it must be zero for nonkeyed Data Queues. For keyed Data Queues it must be equal to the length specified on the KEYLEN parameter on the Create Data Queue (CreateDataQ) method. |
$KeyData |
|
|
$WithRemoveMsg |
‘N’- default |
Whether the message is to be removed from the Data Queue when it is received. |
Sample Code
|
$data = $DQ->ReceieveDataQueue(0, 'GE', 15, $data, 'N') |
|
SendDataQueue
SendDataQueue($DataLen, $Data, $KeyLength, $KeyData) - Read a message from a Data Queue.
Arguments |
Value |
Description |
$DataLen |
|
The length of the message data. The minimum length is 8 bytes. |
$Data |
|
The message data |
$KeyLength |
|
Key length |
$KeyData |
|
Key value |
Sample Code
|
$DQ->SendDataQueue(25.0, $message, 15.0, $key) |
|
ClearDQ
ClearDQ($KeyOrder, $KeyLength, $KeyData) - Clear a Data Queue object.
Arguments |
Value |
Description |
$KeyOrder |
|
The comparison criteria between the keys of messages on the Data Queue and the key data parameter. When the system searches for the requested key, the entries are searched in ascending order from the lowest value key to the highest value key until a match is found. If there are entries with duplicate keys, the entry that was put on the queue first is received. Valid values are:
This parameter is ignored if the length of key data is zero. A value of blanks is recommended if the length of key data is zero. |
$KeyLength |
|
Key length |
$KeyData |
|
Key value |
Sample Code
|
$DQ->ClearDQ( ‘EQ’, 15.0, $key) |
|
A PHP Script That Shows the Usage of All Data Queue Methods
|
<?php |