[Twisted-Python] [twisted-conch] Using flow package to control workflow

Paul Swartz z3p at twistedmatrix.com
Tue Aug 19 10:50:53 EDT 2003


On Tue, Aug 19, 2003 at 02:20:01PM +0200, mkimpenhaus at plus.de wrote:
> Hi @all,
> 
> I am very sorry, but again I need some advice using the conch package, 
> better in this case using the flow package together with conch.

I know nothing  about flow, but I'll try to answer your questions.

> Problem is -> I am using conch to connect per ssh to an server -> execute 
> some scripts on the ssh-server -> got the callback and process the result.
> For now this is working fine, but there's the problem when triggering the 
> connection this method is used to give an resultset. Therefore I thought 
> to use the flow package to block the triggering method until the result 
> comes.

The last part of that paragraph made no sense.  "triggering the
connection this method is used to give a result set"?  Does that mean
the client class has a function you call with the result?  In general,
the way to "block" on a method is to have that method return a Deferred,
which is called back with the results.  Actual blocking methods will
hang the reactor as it will have to wait for your method to return as
well.

> First, is this attempt ok ? Is it possible to use flow to synchronize that 
> async thingie??

> Next, what should I use -> I tried to use flow.Block() but now the whole 
> script seem to hang?

These are both flow questions, so hopefully someone else can answer
them.

-p
-- 
       Paul Swartz
(o_    http://www.twistedmatrix.com/users/z3p.twistd/  _o)
//\    z3p at twistedmatrix.com                           /\\
V_/_   AIM: z3penguin                                 _\_V->




More information about the Twisted-Python mailing list