Share this page

# TCA.useAsyncAPI

Notifies the execution engine that an asynchronous API will be invoked, so that the engine waits for completion notification.

Note: Generally there is no need to call this function because the execution engine knows to wait for asynchronous operation completion when the user calls an asynchronous API. Use this function only when an asynchronous API is invoked in an asynchronous execution block, such as setTimeout. This function should be called outside of an asynchronous execution block, preferably at the beginning of the whole

    TCA.useAsyncAPI();

## Arguments

None

## Return value

None

## Example

Copy code

    TCA.useAsyncAPI();
    setTimeout(function() {
       IOA.read(TC.scriptDir + "mylog.txt").then(function(data){
         TCA.done(data);
       }).catch(function (error) {
         TCA.doneWithError(error);
       });

    }, 1000);

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: