On Jun 25, 9:58 am, Graham Dumpleton <graham.dumple...@gmail.com>
wrote:
> On Jun 25, 9:35 am, qwcode <qwc...@gmail.com> wrote:
>
> > This is a re-phrase of a previous email... trying to trigger an answer
> > using terms that might make more sense to this list. I'm more
> > familiar with java frameworks.
>
> > Is there a way to have objects persist in memory that don't time out?
>
> > For example, in cherrypy, there's an Application object that persists
> > from when cherrypy starts until it stops. In Java frameworks,
> > there's the ServletContext. .Net apps have something similar.
>
> > Is this not supported in wsgi?
>
> If you mean a specific object instance which describes the underlying
> web server attributes, then for WSGI the answer is no. This is because
> WSGI is meant to be hosted on different web servers and as such how
> the underlying web server captures such information will be different
> and isn't standardised. Thus WSGI doesn't attempt to provide a single
> interface for accessing such information.
>
> This doesn't mean that an application which can be hosted on top of
> WSGI doesn't provide such an object, but it will be application/
> framework specific.
Also read:
http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading
Aspects of sharing data discussed is applicable across different WSGI
implementations as far as multiprocess/multithreading issues go.
So, as far as question you pose in different thread, look at Python
module global variables. If you don't understand how that helps, then
you don't understand how Python global variables work. Just be aware
of the issues that global variables cause in context of multiprocess
web server as described in documentation above.
BTW, please don't create separate threads for the same topic like you
have.
Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---