Can I use "call function" in an async function?

Support
  • Lets say I have four functions in one script: Main, controller, load and inputCredentials.

    The Main function is essentially only a loop waiting for new credentials. when it gets the new credentials (through an api) it starts controller function using "call function asynchronously" module. Then the controller calls load and inputCredentials functions.

    So, the controller can work asynchronously with the Main function and the async thread will end when the account is created. Is that possible? If not, what is the alternative approach?

    Test Script:
    test_script.xml

  • using "call function in several threads" with 1 thread, 1 success and 1 fail will probably solve the problem. It maybe is the better approach. However, I'm still curious how to handle promises in async functions within BAS.

  • @pirkhezr Asynchronous functions and multi-threaded function calls operate independently of the main logic; they do not have shared variables.

    To use logic and transfer data within such functions, use global variables, as they can transfer data within functions, which local variables cannot do.

  • This post is deleted!
  • That helped a lot. I thought because I'm parsing value to parameters I don't need global variables. But, is it possible to call another async function inside an async function?