[Twisted-Python] Clarification or pausing a consumer

Barry Scott barry.scott at forcepoint.com
Fri Oct 13 06:29:17 MDT 2017


I have a app that needs to send data as an http response. But the data is 
produced slowly. More slowly then the time taken to transmit it.

The consumer keeps calling resumeProducing, but there is no data to send 
often.

What is the correct way to pause the consumer so that it does not keep
calling resumeProducing? unregisterProducer?

Then when the next block of data is available what is the correct way to
resume the consumer? registerProducer?

Related to that why does HTTPChannel.registerProducer convert a IPullProducer 
into a IPushProducer using _PullToPush?

Barry



More information about the Twisted-Python mailing list