Essentially I have some local plugin logic set in place using the JS API to run at certain times (when user first opens sketch document, when user switches pages in sketch document, when user modifies a string on a sketch document, and every 5 minutes in general).
At a high level, the logic that is being performed basically parses sketch text layers recursively and depending on the # of text layers on the page, it can take a few seconds to complete (sometimes up to 10 seconds sometimes)
An issue i'm running into is that when these calculations are taking place, it seems to use local resources to the point where it will render the user incapable of interacting with the sketch document until after the calculations are complete. The mouse cursor will turn into a spinning circle and the user won't be able to interact with the page, pane around the design, etc. until after the calculations are complete (at which point normal sketch functionality resumes).
Is there someway to offload this load onto another thread process or somehow allow sketch to still function smoothly while these operations are taking place?