need a way to block on pending async call
Submitted by Allison (desrt)
I've often wanted a way to block on a pending async call.
Of course this is useful for the case of turning an async call into a sync one (using the ages old private maincontext trick). My usecase is different, though: I want to be able to take an async call that was already dispatched and block until it completes.
This is a pretty complicated affair, seeing as the async call could have subcalls inside of it. I think more or less the only way that this could work is to create a private main context from the start and dispatch the call from there. The private context would then need a way of being chained onto the user's main context.
So in effect, this bug is about creating a GSource for GMainContext itself: one that dispatches when the nested maincontext has some work to do.