[Twisted-web] Adding data to the request

Matt Goodall matt at pollenation.net
Thu Sep 16 05:09:13 MDT 2004


On Thu, 2004-09-16 at 10:52, Syver Enstad wrote:
> Matt Goodall <matt at pollenation.net> writes:
> 
> >     request.setComponent(IFoo, foo)
> > 
> > 
> > And finally, do something like this to retrieve the data from the
> > request:
> > 
> >     foo = request.getComponent(IFoo)
> 
> Thanks Matt that certainly seems to do what I want. If the foo object
> also disappear when the request is finished then this is exactly what
> I want.

Normal Python garbage collection rules should apply, i.e. there are no
guarantees about what will happen but as long as you don't hang on to
other references to foo then foo will get GC'd at the same time as the
request object.

Cheers, Matt

-- 
Matt Goodall <matt at pollenation.net>




More information about the Twisted-web mailing list