Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : CANCEL-REQUESTS-AFTER( ) method
 

CANCEL-REQUESTS-AFTER( ) method

Calls the CANCEL-REQUESTS-AFTER( ) method on the server object after the specified number of seconds have elapsed. When CANCEL-REQUESTS-AFTER( ) is called, all requests currently running or queued to run on the server object are cancelled, regardless of when they were started.
If the method is called on a server object that already has a timer running, the timer is restarted with the new time interval, measured from that moment.
If the method is called with a parameter whose value is less than or equal to zero, then the timer on that server object is stopped.
Return type: LOGICAL
Applies to: Server object handle

Syntax

CANCEL-REQUESTS-AFTER ( seconds )
seconds
This required integer parameter specifies the number of seconds before the CANCEL-REQUESTS-AFTER( ) method is called on the server object.
The method returns TRUE unless an error occurs while setting the timer. In that case, the method returns FALSE, and the timeout is not set.

Example

The following simple example uses the CANCEL-REQUESTS-AFTER( ) method:
DEFINE VARIABLE hSrv as HANDLE.
DEFINE VARIABLE bool as BOOLEAN.

CREATE SERVER hSrv.
hSrv:CONNECT("-URL AppServerDC://hostName/svc").

bool = hSrv:CANCEL-REQUESTS-AFTER(30).
RUN foo.p ON SERVER hSrv ASYNCHRONOUS ("Hello World").

WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.

Notes

Calling this method on a server object has no immediate effect on any asynchronous requests that are currently running (or queued to run) on that server object. Moreover, the length of time these requests have already been running prior to the call does not effect the timer.
The method can be called before or after the asynchronous requests are run. Any asynchronous requests that are run after the method is called must complete before the timer expires. The time available to complete such a request depends on when it was executed, with respect to the CANCEL-REQUESTS-AFTER( ) method call.
The timer has no effect on requests run synchronously during the time interval. Synchronous requests are not cancelled, even if they run longer than the specified timeout.
Manually calling the CANCEL-REQUESTS-AFTER( ) method in the application program during the timeout period has no effect on the timer.

See also

CANCEL-REQUESTS( ) method