On Sun, 2010-11-07 at 19:17 +0200, Marius Gedminas wrote:
> On Sun, Nov 07, 2010 at 04:11:19PM +0200, Marius Gedminas wrote:
> > http://docs.pylonshq.com/pyramid/dev/narr/urldispatch.html#cleaning-up-after-a-request
> > recommends this for running cleanup code after request processing:
> > 
> <...>
> > 
> > I'm uneasy about the __del__.  If used, it would prevent people from porting
> > their Pyramid apps to Jython or PyPy.
> > 
> > Isn't there a better way?  The note in that section mentions middleware
> > which can run cleanup code after request processing, but it's a bit
> > heavyweight.
> 
> I'm speed-reading the docs in order, and just got to
> http://docs.pylonshq.com/pyramid/dev/narr/hooks.html#using-finished-callbacks
> 
> Why not recommend this method instead of __del__?

Yeah, the docs are of various strata, the __del__ example should
probably be converted to use a finished callback.

The __del__ example, however, is still useful when you need something to
happen when the wsgi environment disappears, rather than when the BFG
request has ended.

- C


-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-de...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to