How to wait for finishing all asynchronous calls

Posted by Kai Siegele on 09-Feb-2017 09:11

Hallo,

I am invoking a procedure using an asynchronous request as described in http://knowledgebase.progress.com/articles/Article/20785 a lot of times. Now I want to know whether all requests have been processed. For that purpose I have used the code from the article in the knowledge base with small modification.

    DO WHILE NOT hAppServer:COMPLETE:
      PROCESS EVENTS.
      IF hAppServer:COMPLETE THEN
        MESSAGE "Finished !!!"  VIEW-AS ALERT-BOX INFORMATION.
      ELSE /* Async result not ready, so do something else. */
        MESSAGE "Not yet ..." VIEW-AS ALERT-BOX INFORMATION.
    END.


Unfortunately I got the error that COMPLETE is not a queryable attribute for SERVER widget. (4052)

Has anyone an idea where I have made a mistake?

Kind regards

Kai Siegele

Posted by Brian K. Maher on 09-Feb-2017 09:18

YourAppServerHandle:ASYNC-REQUEST-COUNT
 

All Replies

Posted by Brian K. Maher on 09-Feb-2017 09:18

YourAppServerHandle:ASYNC-REQUEST-COUNT
 

Posted by Kai Siegele on 10-Feb-2017 01:57

Hallo Brian,

thank you for your answer, but I wonder why the code of knowledge base has ever worked.

Kind regards

Kai Siegele

Posted by Fernando Souza on 10-Feb-2017 06:33

You are right, the knowledge base entry needs to be fixed. The COMPLETE attribute applies to the asynchronous request object, so replace hServer:COMPLETE with hProcess:COMPLETE.

This thread is closed