[Twisted-Python] When do calls to transport.write() block ?

Itamar Shtull-Trauring itamar at itamarst.org
Tue May 11 09:21:10 MDT 2004


On Tue, 2004-05-11 at 11:12, Stefan Behnel wrote:

> If a server starts sending as fast as it can, what will happen to the
> output queue? Will Twisted just eat up all memory with buffers? Will
> it start blocking? Will it open up a thread? What will it do?

It will eat up all your memory. You should, therefore, not do that.
Instead, use producers and consumers (this is e.g. how the web server
sends large files):

http://itamarst.org/writings/etech04/twisted_internet-101.html

-- 
Itamar Shtull-Trauring    http://itamarst.org
Looking for a job -- http://itamarst.org/resume.html






More information about the Twisted-Python mailing list