Mailing List Archive

preloading stashed variables
I'm using 4.34 right now, although I suspect this applies to 5 as
well. I'd like to instantiate a few objects when my application first
starts up, and have those objects stay persistent and accessible
throughout the lifespan of the application. My thinking was that I
would store those objects in stash. My question is, where do I
instantiate those objects? If I instantiate them in !begin, then
those objects will be instantiated every time an action is called, no?

-Eugene

--
======================================================================
Eugene Eric Kim ......................... http://public.xdi.org/=eekim
Blue Oxen Associates ........................ http://www.blueoxen.org/
======================================================================
preloading stashed variables [ In reply to ]
Am 07.04.2005 um 08:32 schrieb Eugene Eric Kim:

> I'm using 4.34 right now, although I suspect this applies to 5 as
> well. I'd like to instantiate a few objects when my application first
> starts up, and have those objects stay persistent and accessible
> throughout the lifespan of the application. My thinking was that I
> would store those objects in stash. My question is, where do I
> instantiate those objects? If I instantiate them in !begin, then
> those objects will be instantiated every time an action is called, no?

The whole context $c gets reinstantiated on every request, so you can't
store it in the stash.
begin is also called on every request.

Models, Views, Controllers and Plugins are instantiated at startup.
I guess your objects fit in one of those categories. :)

--
sebastian
preloading stashed variables [ In reply to ]
On Thu, Apr 07, 2005 at 10:52:01AM +0200, Sebastian Riedel wrote:

> The whole context $c gets reinstantiated on every request, so you can't
> store it in the stash.
> begin is also called on every request.
>
> Models, Views, Controllers and Plugins are instantiated at startup.
> I guess your objects fit in one of those categories. :)

Duh, should have figured that one out myself. Thanks! :-)

-Eugene

--
======================================================================
Eugene Eric Kim ......................... http://public.xdi.org/=eekim
Blue Oxen Associates ........................ http://www.blueoxen.org/
======================================================================