Il mar, 2003-09-30 alle 20:45, Christopher Armstrong ha scritto:
On Tue, Sep 30, 2003 at 06:27:43PM +0200, Federico Di Gregorio wrote:
now, for a simple get session/execute/end sequence i don't want to write n+1 callbacks (one that waits for new_session and call execute, next one that wait on execute and call next, etc.) so here is what I did (inside a mixin class used in the client):
If you _really_ want to try avoiding all the callbacks, I think your hack is the wrong way to do it. Use something like twisted.flow's
no, i don't want to avoid all the callbacks. i just don't want to write three one-line callbacks for a simple call.
Deferred support: this way, you "yield" when you wait for a Deferred to fire, and then you will be able to get the result synchronously once your function is returned. There's probably an example somewhere in the flow docstrings or examples.
but i'll look into flow anyway. :) -- Federico Di Gregorio Debian GNU/Linux Developer fog@debian.org INIT.D Developer fog@initd.org Viviamo in un mondo reale, Ciccio. -- Lucy