Is there any recommendation or guideline for frequent API call cases?
ex) Continuous 10ms (100 times in a sec) API calls
If there are many executeAsModal() calls, Photoshop API cases exception. “Too many modal scope commands” and “Large number of pending promises”. I think it seems issue on more than 20+ built up cases.
Then I tried timered buffering to throttle down API request like 100ms or some case 200ms. It works, ut user response degrade. 100ms is not much noticeable, but still not smooth in some cases.
I asked to Dev Day event and got info about isModal() and modalJavaScriptScopeExit
Thank you for Jaroslav and Jesper at the time.
As I tested the flag and event seems working fine.But I’m not quite sure how to optimize the API calls. So is there some recommendation or guideline?
It might be wrong, but my understanding is that Photoshop API has its own queueing mechanism. Request comes back but some times it is executed a bit later. I’m not sure if it is synced with modalJavaScriptScopeEnter and modalJavaScriptScopeExit event timing, or it can be different timing.
Any tips, help are appreciated. Thank you.