[Twisted-Python] Asynchronously reading posted data

Paul Wiseman poalman at gmail.com
Thu Sep 5 07:23:12 MDT 2013


Ah awesome that clears it up, thanks! I've never had to deal with HTTP
requests with content bodies before.

I presumed that the .read() would be pulling bytes from the network. I
presumed wrong :)

Thanks!

Paul


On 5 September 2013 12:24, <exarkun at twistedmatrix.com> wrote:

> On 08:50 am, poalman at gmail.com wrote:
>
>> Hey,
>>
>> Thanks for your reply! The json data should never be too long so I'm not
>> worried about the memory usage, I need the whole json object to start
>> working anyway realistically - I was more concerned about blocking reading
>> the data from the network - specifically the request.content.read(), if
>> the
>> client happens to be sending it very slowly this would block everything up
>> right? - or would this not be an issue?
>>
>> Maybe because I have fairly small content bodies I wont have to worry?
>>
>
> Your resource isn't asked to render a response until the request has been
> fully received.  Request.content is a StringIO (if it is small) or a
> temporary file (if it is larger).  Reading from the temporary file blocks
> for a little bit since disks are slow but unless your system is seriously
> loaded you can usually disregard this.
>
> Jean-Paul
>
>
> ______________________________**_________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.**com <Twisted-Python at twistedmatrix.com>
> http://twistedmatrix.com/cgi-**bin/mailman/listinfo/twisted-**python<http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20130905/cf4a0ff6/attachment.html>


More information about the Twisted-Python mailing list