[Twisted-Python] transport.write clarification
![](https://secure.gravatar.com/avatar/cd9337920b377ee5ced71e3bbec80b06.jpg?s=120&d=mm&r=g)
Hello, I'm working on porting the mod_pubsub system to use the twisted framework. So far things are great, but I have one point of clarificaction. With all the standard reactors, how are writes handled in a non-blocking manner? Copying from some of the sample protocols, I have a dataReceived method in my Protocol implementation that looks vaguely like this: def dataReceived(self, data): self.inbuf += data if self.canReply() == true: self.transport.write(self.response) My question is: does write() make a non-blocking write, and if so does it reschedule itself later on automatically? Does it block? What is the preferred way of handling this? Thanks, George
![](https://secure.gravatar.com/avatar/d7875f8cfd8ba9262bfff2bf6f6f9b35.jpg?s=120&d=mm&r=g)
On Sat, 2004-07-31 at 15:55, George Schlossnagle wrote:
It doesn't block, and if it can't write it buffers for you. You just don't have to worry about it. -- Itamar Shtull-Trauring http://itamarst.org
![](https://secure.gravatar.com/avatar/d7875f8cfd8ba9262bfff2bf6f6f9b35.jpg?s=120&d=mm&r=g)
On Sat, 2004-07-31 at 15:55, George Schlossnagle wrote:
It doesn't block, and if it can't write it buffers for you. You just don't have to worry about it. -- Itamar Shtull-Trauring http://itamarst.org
participants (3)
-
Bob Ippolito
-
George Schlossnagle
-
Itamar Shtull-Trauring