helper for synchronize promise and callback and manage variables on Fiber Thread as ThreadLocal
Turns asynchronous function into synchronous