[Twisted-Python] Couched 0.1: CouchDB twisted client

Henrik Thostrup Jensen thostrup at gmail.com
Fri Sep 5 19:25:36 EDT 2008


2008/9/5 Jean-Paul Calderone <exarkun at divmod.com>

> On Fri, 5 Sep 2008 09:48:08 +0200, Henrik Thostrup Jensen <
> thostrup at gmail.com> wrote:
>
>> [snip]
>> Twisted web is currently not an option (I need request pipelining and http
>> 1.1).
>>
>
> Which other HTTP 1.1 features do you need?
>

HTTP 1.1 status codes, notable 303 (see other). I could probably use 302,
but 303 is the "correct" behaviour for my case. This should be relatively
easy to implement.

Furthermore I need the server to support large uploads (last i checked the
640K limitation was still there) and downloads, and with reasonable
efficiancy.  I'm not saying streams are the answer but it works for me
(actually I use the producer/consumer interface in my lower level code and
then adapt it in the web layer). Unfortunately I've had to rewrite a lot of
the producer/consumer code and stream stuff and glue it together, as some of
the stuff in twisted (not just in web2) is rather broken. For complete
insanity (sorry to whoever wrote it ) see
twisted.protocols.basic.FileSender, which implements its own magic method
beginFileTransfer, which takes BOTH a file and a consumer as argument. This
makes is impossible to seperate the construction of the producer and
starting the transfer.

Ticket #1956 fixes some of these things. I'm not quite sure how it handles
errors (which can happen both ways), but I've just had a quick look. It's
been a whlie since i've had a look at all this. I write a bit about it,
which I've placed here: http://www.cs.aau.dk/~htj/prodcons.txt

IMHO, getting (and deciding on) a proper producer/consumer interface need to
happen, to make whatever web things twisted will have usefull. Changing the
producer/consumer might be massive API break, however it is a needed one.
There are simply things the current API cannot do (i usually return a
deferred along with any producer/consumer object to indiciate how the data
moving went). I might be interested in participating in this, however I'm
rather work struck as I have to hand my ph.d. thesis at the end of this
year.

Btw. I really am a huge fan of twisted, however the web and
producer/consumer is a rather dark spot in an otherwise bright world :-)


-- 
- Henrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20080906/8bbc5c3a/attachment.htm 


More information about the Twisted-Python mailing list