[Twisted-Python] deferred folies

Federico Di Gregorio fog at initd.org
Tue Sep 30 12:52:06 MDT 2003


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 at debian.org
INIT.D Developer                                           fog at initd.org
                              Viviamo in un mondo reale, Ciccio. -- Lucy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa parte del messaggio รจ firmata
URL: </pipermail/twisted-python/attachments/20030930/197740f4/attachment.sig>


More information about the Twisted-Python mailing list