I have task that is running from other module, and when it is finished it executes callback method from background service. However when calling this method i get unexpected type error. I am assuming this is because background exited without finishing. Is there a way to prevent that and keep background waiting until task is finished.
function onTemporalEvent() as Void {
TaskUtils.initTask(method(:onFinished));
}
function onFinished() as Void {
// do something
}
After second look at error i figured, that error is not about background service, but with my global Scheduler which which was not accessible for background. Once again I am shooting myself with global variables, but thank you for hint to double check error :)