Note: My project needs to run at OS version before iOS 13, so I can not use async/await feature.
In JS world a Promise is awaitable, so I want to use Promise in the same way, library like Google's promises have an await API promises/index.md at master · google/promises (github.com)
but it uses GCD semaphore to block the current thread, the current thread mostly is the main thread, docs of promises library is recommended to use await in a background thread, it can work, but will cause other issues, like UI refresh mostly needed after network request end, with this solution, developers will need to dispatch to main thread manually, so I think this solution is hard to use.
swift-nio library offers a Future and Promise implement, but it needs to maintain the eventloop by the developer, seems it's not a good idea.
So does there have some solution to make Promise can be await at the main thread? like Swift 5.5 await feature.