View Single Post
epage's Avatar
Posts: 1,684 | Thanked: 1,562 times | Joined on Jun 2008 @ Austin, TX
#9
Take a look at the "login" and "_login" functions in the following file
https://github.com/epage/The-One-Rin...ice/session.py

"login" creates a AsyncLinearExecution which runs "_login" in the foreground thread but everything at a "yield" in a background thread. Looking at the "_login" function this takes what would be two or three callbacks with different kinds of state and simplifies it to a single function.

EDIT: And since I wrote that code, I've generalized it for both Qt and GTK. Makes callback code a lot simpler. Each piece of code after a "yield" is runs as a callback and you would have had to find a way to pass all that state to that callback.
__________________
770, n810, n900, Ideapad S10-3t
TheOneRing, DialCentral, Gonvert, Quicknote, Multilist, ejpi, nQa, Waters of Shiloah
Programming Blog