Because I was caching entire pages generated by a controller,
I dodged working out such a creation function (with its own
controller
environment and SA session). Instead I wrote a middleware that
intercepts
a page request, fires up a thread that does a urllib.urlretrieve on
that same
url but with a secret update-the-cache url parameter set, meanwhile
proceeding with forwarding the request along the stack for processing
in the usual way (which will ultimately fetch the currently cached
version
of the requested page with no delay).

On May 7, 10:42 am, Ben Bangert <b...@groovie.org> wrote:
>
> This would carry some fairly obvious issues about what the creation  
> function for the expired value can do, since you'd have to deal with  
> the fact that its going to run in a separate thread, ie, you can't  
> just use an SA session in closure scope in the creation function.  
> You'd have to be rather careful about what the creation function does  
> to ensure it'd run in a separate thread.

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

Reply via email to