I am using the User Process Scheduler to perform custom tasks on a schedule.
I’d like to utilize this to cycle over query results and call a REST endpoint from another system, but I’d like to understand if there are blocking implications of executing a potentially heavy task synchronously.
What are the implications of executing async vs. sync on a block of custom code?
When should I use async. vs. sync?
If you are doing it using the User Process Scheduler, I imagine it doesn’t matter, there should be one process run PER Task so each task technically should run on its own “thread”
Regular BPMs though you want to do as much as you can async, since you are hanging up the server side while the client (user) is waiting for a response. However if the response back to the client requires waiting on your changes then obviously async won’t work. But keep it in mind.
In this case there isn’t a person waiting for a response so you should be safe. Depending on the version of Epicor async BPMs may not work very well.
I know there used to be issues with async going into a black hole, but it sounds like it’s fixed?
Ok that’s good to know that the process itself creates it’s own thread. I was concerned that the process would block other threads while waiting for a response.
Here’s another questions; can the custom code execute an async/await or is that just limited to defining it via the BPM interface?