[Twisted-Python] Analog to asyncore.dispatcher.handle_write()?

Itamar Shtull-Trauring itamar at itamarst.org
Thu Dec 22 14:47:05 EST 2005

On Thu, 2005-12-22 at 19:26 +0000, dkarbott at comcast.net wrote:

> I want to write a twisted.internet.protocol.Protocol implementation
> which doesn't write too far ahead of the socket it's writing into.
> How do I get a notification when the underlying socket is ready to
> write more data?

transports have a registerProducer(consumer, streaming) method, as they
are consumers - see twisted.internet.interface.IConsumer and IProducer.
You would implement a producer (the protocol instance, for example) with
the resumeProducing, pauseProducing, stopProducing methods which would
get called depending on socket state.

More information about the Twisted-Python mailing list