[Twisted-web] Re: streaming request (was: status of Twisted Web and Web 2)

David Bolen db3l.net at gmail.com
Fri Mar 7 17:43:13 EST 2008


Andrew McNabb <amcnabb at mcnabbs.org> writes:

> If I'm (finally) understanding you correctly, your case is one where we
> are a server and handling a POST request.  In my application, I'm
> dealing with streaming _downloads_, not streaming _uploads_ (i.e., mine
> is client side rather than server side).  My code would look something
> like this:

I've been following this thread, but now I'm confused too, since I
also assumed you were talking about uploading to the server.

Your original post talked about web vs. web2, and how you needed to
augment web to handle streaming to "receive" (which I interpreted to
mean from the server perspective since that's the twisted.web code)
large files.

If you're talking about transmitting large files to a client,
twisted.web should already work just fine - unlike receiving where it
does require entirely buffering file uploads before notifying the
Resource of a request.

In my case, rather than push the file myself (and yes, it can use the
existing producer/consumer interface), I just reused
static.FileTransfer, which is a Producer, and registers itself with
the Request object.

It doesn't block the server while doing the transfer.

Or am I still misunderstanding your original post?

-- David




More information about the Twisted-web mailing list