[Twisted-Python] understanding IConsumer

Glyph Lefkowitz glyph at twistedmatrix.com
Wed Sep 9 21:15:25 MDT 2015


The best way to come to a good understanding of IConsumer and IProducer is to write something that transfers large amounts of data over a slow, or heavily asymmetric link, and make sure its memory usage stays consistent; just implementing the methods on IConsumer won't be that illuminating.

> On Sep 9, 2015, at 7:36 PM, Roshan Cherian <cherian.rosh at gmail.com> wrote:
> 
> Thanks Glyph for setting my understanding right on this. By create a consumer I meant having to write one purely to understand the concept and have one running example so that when looking at consumers like ProducerStream it will make my understanding more clear.
> 
> Thanks,
> -Roshan
> 
> On Wed, Sep 9, 2015 at 11:40 AM, Glyph Lefkowitz <glyph at twistedmatrix.com <mailto:glyph at twistedmatrix.com>> wrote:
> 
>> On Sep 8, 2015, at 11:24 PM, Roshan Cherian <cherian.rosh at gmail.com <mailto:cherian.rosh at gmail.com>> wrote:
>> 
>> I understand there is https://twistedmatrix.com/documents/15.4.0/core/howto/producers.html <https://twistedmatrix.com/documents/15.4.0/core/howto/producers.html>, however I was hoping if there is an example of a simple consumer which could be written using the data from dataReceived (that is assuming whatever I understood above is correct). I didn't find enough information on how to create a consumer.
> 
> What do you mean by "create a consumer"?  You already have an IConsumer created for you: your transport.  Do you want to implement your own?  For what reason?
> 
> -glyph
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com <mailto:Twisted-Python at twistedmatrix.com>
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python <http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python>
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20150909/3bf27315/attachment-0002.html>


More information about the Twisted-Python mailing list