[Twisted-Python] A C/S Application over Internet

陶艺夫 artman328 at gmail.com
Thu Aug 27 20:16:21 EDT 2009


thank you for sharing your experience.
Frankly, I do love twisted for its decent implementation of asyn call
concept.

2009/8/28 Phil Christensen <phil at bubblehouse.org>

> On Aug 27, 2009, at 10:57 AM, 陶艺夫 wrote:
> > Thank you, Phil.
> >
> > Pyro has many examples, so I can understand it easily. I know
> > Twisted is great. I think your "switching" must mean something :) .
> > So I decide to use twisted PB.
>
>
> Great!
>
> I also remembered one thing that I found was extremely useful when
> dealing with a GUI app that communicates over PB. Since PB assumes
> every remote method call will take an arbitrary amount of time to
> execute, you can delay the response from the client as long as you need.
>
> For example, let's say the server sends a block of text to the client
> for editing. Your client-side function can create a Deferred, hold a
> reference to it somewhere, and return that from the client function.
>
> PB won't actually send a response until you invoke the callback()
> method on that Deferred, so you can pop open a GUI window, let the
> user edit the text (or just sit there staring at it for an hour), and
> then trigger the callback when the user hits 'Save'.
>
> Very useful, although I wrote some incredibly stupid code to emulate
> this long before I realized how easy it was ;-)
>
> -phil
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20090828/5440f0f9/attachment.htm 


More information about the Twisted-Python mailing list