Kbase P58542: How to end a subscribing 4GL Adapter client session at a cer
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/02/2004 |
|
Status: Unverified
GOAL:
How to end a subscribing 4GL Adapter client session at a certain time?
FIX:
The waitForMessages API session call has 3 parameters, the third parameter is a time out integer.
To end a program at a certain time, you will need to set the timeToWait parameter
to an integer. For example, If you want the program to end in 1 second, you would
assign timeToWait = 1.
Example Code Snippet:
RUN waitformessages IN pubsubsession ("inWait", THIS-PROCEDURE, timeToWait).
PROCEDURE golfHandler:
DEFINE INPUT PARAMETER messageH AS HANDLE.
DEFINE INPUT PARAMETER msgConsumerH AS HANDLE.
DEFINE OUTPUT PARAMETER replyH AS HANDLE.
vtext = DYNAMIC-FUNCTION('getText' IN messageh).
FUNCTION inWait RETURNS LOGICAL.
IF vtext = "stop" THEN DO:
timetowait = "1".
RETURN stillWaiting.
END.
RETURN stillWaiting.
END.