[Twisted-Python] Understanding Deferreds/callback further

Phil Mayers p.mayers at imperial.ac.uk
Wed Nov 8 03:39:51 EST 2006

Yi Qiang wrote:
> On 11/3/06, *Phil Mayers* <p.mayers at imperial.ac.uk 
> <mailto:p.mayers at imperial.ac.uk>> wrote:
>     Yi Qiang wrote:
>      > This is the part where I stumble on though, the exact
>     implementation of
>      > how to make it so that one calls back the other.
>     One what calls back the other what?
>     You'll have issues with error handling and dropping workers if you're
>     not careful to chain the deferreds correctly. I would try something like
>     this personally. ...
> Hi Phil,
> Sorry it took me so long to get back to you.  Thanks for your 
> suggestion, but the thing I was trying to avoid is to have the Workers 
> communicate with the PB server.  There could be potentially many workers 
> and when I thought about the problem, it seemed cleaner to design 
> something where the client consisted of a 'Monitor' and 'Workers'.  The 
> monitor connects to the server, gets jobs, distributes jobs to the 
> workers and watches for workers who finished their jobs.  What do you 
> think of this design?  It is obviously a little more convoluted to 
> program but might be easier to deal with in the future.  I have little 
> programming experience so this is all speculation from my side.  Any 
> insight would be greatly appreciated.

To be honest, the problem still seems a little abstract to me, and I'm 
having a hard time figuring out exactly what you're trying to achieve. 
Surely the clients have to submit *some* form of completion status to 
the PB server?

The "Monitor" portion of the clients seem superfluous - what does it 
achieve that having the worker submit the completion does not?

Without a more concrete description I'm afraid I don't have much more 
useful to add.

More information about the Twisted-Python mailing list