[Twisted-Python] PullProducer appreciation, lack thereof.
radix at twistedmatrix.com
Wed Apr 2 19:14:16 EST 2003
On Wed, Apr 02, 2003 at 08:17:53PM +0000, Clark C. Evans wrote:
> On Wed, Apr 02, 2003 at 12:56:00PM -0500, Itamar Shtull-Trauring wrote:
> | > On Mon, 2003-03-24 at 14:29, radix CVS wrote:
> | > > class IPullProducer(IProducer):
> | > > """A pull producer, also known as a non-streaming producer, is
> | > > expected to produce data each time resumeProducing() is called.
> | > > """
> | > > def resumeProducing(self):
> | > > """Resume producing data.
> | > > This tells a producer to re-add itself to the main loop and
> | > > produce more data for its consumer."""
> | >
> | > Usage and behaviour of a PullProducer isn't clear to me. Does
> | > PullProducer.resumeProducing mean that it should call consumer.write
> | > exactly once?
> | Yes.
> This is also similar to the 'flow' module by Bob Ippolito (etrepum)
> and somewhat distantly related to my flow module; only that mine is
> more 'push' like. Both are attempts at bringing an async
> producer into play, where the producer could at any time block.
block? No.. Producers and Consumers have nothing to do with blocking..
Twisted | Christopher Armstrong: International Man of Twistery
Radix | Release Manager, Twisted Project
More information about the Twisted-Python