Closed mortenholmgaard closed 8 years ago
It's definitely used in different places. I usually just use Async.main {}
so that I'm guaranteed to be on the main thread. Doing it sync if already on main, doesn't give me anything extra, but concerns if code acts different because it changes between being async and sync depending on whether how an API is implemented. IMHO.
Also, I don't have any part dispatch_sync
in the library yet.
Feel free to start creating a PR with an implementation and use cases for this!
I will suggest to add an option to call a block either sync on main thread if already on main thread, or else async dispatch on the main thread. I have this usecase quite offen.