![]() |
2011-03-01
, 02:25
|
Posts: 146 |
Thanked: 15 times |
Joined on Oct 2008
|
#12
|
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.
Thanks,
L.
Last edited by luis; 2011-03-01 at 02:47.