[Twisted-Python] A new & improved IResource

Glyph Lefkowitz glyph at twistedmatrix.com
Tue Jun 14 13:07:10 EDT 2011


On Jun 13, 2011, at 9:18 AM, Laurens Van Houtven wrote:

> Hey!
> 
> In relation to my recent getChild problem (specifically, I want to return deferred resources from it), it has become evident that IResource just won't cut it for a number of reasons and we should probably replace the API with something else.
> 
> The issues we should take care of in this new API:
> 
> 1. http://tm.tl/3711 (returning deferreds from render methods)
> 2. http://tm.tl/3621 (returning deferreds from getChild and friends)
> 3. http://tm.tl/288 (accessing uploaded data while in progress)

A new IResource means an opportunity for a new IRequest, since implementing that new interface is the easiest way for a resource to say "I require the new IRequest interface as a parameter to these methods".  This long-standing enhancement would be a nice thing to get in there:

http://tm.tl/1569 (IRequest should have a uri object)

This ticket predates my understanding of many of the nuances of URIs, URLs, URNs, IRIs, IDNA, etc, so URLPath is probably not quite up to the job.  nevow.url is closer, but probably needs some fixing (especially in the area of IRIs).

And, for that matter, some compatibility between the request object used by Agent and the request object used by the server would be great.  That's not necessary for a new interface, but in any design of a new interface, that should be taken into account so that it can satisfy requirements on both sides.

> If there are any missing tickets I'm forgetting about that are only fixable by breaking the interface, now would be a good time to speak up.
> 
> I have created a new ticket (http://tm.tl/5152) for the new interface using an integration branch that addresses the issues in the individual tickets on a new interface as Glyph proposed. I've also commented on #3711 to say that it just won't work that way and that we need a new interface, referring them to the new ticket number.
> 
> What should the migration plan look like? At least from the code point of view, exarkun has already partially answered this question: http://twistedmatrix.com/trac/ticket/288#comment:31
> 
> 
> 
> cheers
> lvh
> 
> _______________________________________________
> 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: http://twistedmatrix.com/pipermail/twisted-python/attachments/20110614/ffc03d55/attachment.htm 


More information about the Twisted-Python mailing list