Disclaimer: I'm mostly extrapolating from code I've read, articles I've read, a few personal projects that attempt to not needlessly block, and a few experiments with the various APIs.
It might very well be that my understanding of this is incomplete, lacking, or wrong. If anyone here has more experience, feel free to correct me as I'd like to know more about this as well.