2009/5/28 <gl...@divmod.com> > > On 01:23 am, asb.b...@gmail.com wrote: > >> I have just started to look at the Twisted framework and would like to put >> it >> to use for a new project I am working on. Not being very familiar with >> the >> framework and fairly new to Python in general I would like to ask a >> design/architecture question. (I have written similar applications in C >> but >> would prefer to start this in the right direction and not write Python >> like >> C.) >> > > Thanks for asking! > > I apologize for the delay in my answer. I started writing up a simple > example (attached) but was discouraged to find that it was 100 lines long > and required too much explaining. > > Then I started documenting it and explaining every line but that was a very > long, tedious message. So, it doesn't have much in the way of explanation; > I hope you will find it useful regardless.
Thanks for the very interesting example which I mainly follow apart from the lineReceived method in the ProxyClient, don't we need to add a callback to the deferred before appending it to the requestQueue? class ProxyClient(LineReceiver): def connectionMade(self): self.requestQueue = [] def forwardLine(self, line): self.sendLine(line) d = Deferred() self.requestQueue.append(d) return d def lineReceived(self, line): self.requestQueue.pop(0).callback(line) Thanks, Michael
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python