[Twisted-Python] Serializing cftp and ssh sessions

Axel Rau Axel.Rau at Chaos1.DE
Wed Oct 22 03:59:49 MDT 2014


Am 20.10.2014 um 16:28 schrieb exarkun at twistedmatrix.com:

>> See above. I must synchronize operations at 2 points in a loop.
>> I tried to do this with callbacks, called at connection shutdown.
>> What do you think about this?
> 
> That sounds like the correct solution to me.  The simplest way to structure your code is to make the APIs for starting these two operations return a Deferred that fires when the operation is complete. Then you can use these Deferreds to construct the desired control flow for starting the operations.
> 
I have implemented this in a prototype, which does what I want, simply by calling the next top level operation when one has completed.
Your suggestion would require to handle the Deferred down to the point of connection termination.

Thanks for your support,
Axel
---
PGP-Key:29E99DD6  ☀ +49 151 2300 9283  ☀ computing @ chaos claudius





More information about the Twisted-Python mailing list