Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
The Text InfoTip associated with "ASYNC" states, "Executes the service asynchronously. Without additional coding (i.e. event subscriptions, property changes, ect.) or logging, values and/or exceptions are not returned."
Can someone explain this a bit better? What's it's impact? What are the Pros/Cons? I'm trying to determine when I need to enable this.
In general, is there s Developers Guide that I can reference for questions like this?
Solved! Go to Solution.
ASynch means the process will run on its own thread and finish whenever it finishes, while it just continues with the remaining code. It means that there isn't a wait for a returned result.
That means you can't output information from that service.
It also means you can't tell if it finishes or not.
So you would need other means to check on the results of running that service.
Synch means the thread runs and returns status and/or information that it is done, before progressing to the next step in the code.
Biggest gain with Asynch is that your calls don't hold up the progression of the code, biggest negative, you have no way of knowing if it ran successfully without some other code and process to check for it.
ASynch means the process will run on its own thread and finish whenever it finishes, while it just continues with the remaining code. It means that there isn't a wait for a returned result.
That means you can't output information from that service.
It also means you can't tell if it finishes or not.
So you would need other means to check on the results of running that service.
Synch means the thread runs and returns status and/or information that it is done, before progressing to the next step in the code.
Biggest gain with Asynch is that your calls don't hold up the progression of the code, biggest negative, you have no way of knowing if it ran successfully without some other code and process to check for it.
Communication on Async services should be done with Events/Subscriptions, when your Aysnc service ends just throw an Event with the result ( ok/ko )
But by the way, if you are asking what's Async/Sync, better don't use Async, it will generate more headaches than gains for you, and TW it's a beat picky with Async and you will end up with lot of blocking situations and instability.
Best Regards,
Carles.
I understand what Async/Sync means in general, I was asking more of the exact behavior in ThingWorx. Thank you Carlos and Pai! After posting this question, I also found Discussion Topic: Re: Asynchronous? Which also answered my question.