[Twisted-Python] streaming producer

Andrea Arcangeli andrea at cpushare.com
Thu Mar 3 09:14:52 MST 2005


Could somebody explain the semantics of the streaming parameter to
registerProducer? I believe I have to set it to 1.

I need to stop data coming from a process protocol, and to do so I need
to register a producer somehow. I need to stop the process protocol when
the TCP transport buffer (or the sendstring buffer or both? I'm using
int32protocol) grows too much (let's say 10mbytes, I like to allow huge
buffering, but at the same time I can't avoid the producer or people
could trigger oom conditions trivially). I don't understand exactly how
I have to setup the thing. I've two protocols, one is the tcp protocol,
the other is the process protocol.

I will probably make the max buffer size configurable dynamically and
accounted in the ram_mbytes selection as well.

It seems twcgi has the very same issue, so I'm taking ideas from there ;).

Thanks!




More information about the Twisted-Python mailing list