plugin: sftp transport

Andrew Bennetts andrew at canonical.com
Thu Oct 20 07:37:14 BST 2005


On Thu, Oct 20, 2005 at 12:59:03AM -0400, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> John A Meinel wrote:
> > My understanding is that the basic cause of this is the
> > "make_synchronous" function call. It causes problems if you call it from
> > inside itself. Is that correct?
> 
> No.  async code cannot call make_synchronous, directly or indirectly.
> The problem is that make_synchronous doesn't just process the thing you
> want to make synchronous.  Other deferreds can be handled, leading to
> concurrency issues.

Isn't concurrency is the point of using async here?  If you have
concurrency, to some extent you have to worry about concurrency issues,
regardless of async vs. threads vs. subprocesses vs. whatever.

> If there were a way to get the reactor to just process the one deferred
> we care about, make_synchronous would be safe, and I'd feel a lot better
> about using twisted.

This statement doesn't really make much sense to me -- Deferreds and the
reactor don't inherently have anything to do with each other.  There's no
part of the reactor that could be said to "process" Deferreds -- and you can
use Deferreds with no reactor at all[1]. 

-Andrew.

[1] There is one ill-conceived method of Deferred, setTimeout, that uses the
    reactor, but it's deprecated.





More information about the bazaar mailing list