[Catalyst] Restarting Catalyst on request or doing something per request

Tomas Doran bobtfish at bobtfish.net
Wed Aug 26 00:30:09 GMT 2009


On 25 Aug 2009, at 16:57, Matthias Dietrich wrote:

> Hi Wade,
>
> Am 25.08.2009 um 13:48 schrieb Wade Stuart:
>> Why cant you just do a:
>>
>> # ... incrementally add new lexicons
>>    Locale::Maketext::Lexicon->import({
>>        de => [Gettext => 'local/hello/de.po'],
>>
>>    })
>> ... on change instead of reloading apache?
>
> because this would only affect the current apache child process (at  
> least under mod_perl).  All other clients will still have the old  
> lexicon.


Right - so use some form of caching scheme to save a lexicon  
'generation' key.

Bump the value of that key when the lexicon is changed. The first time  
you use the lexicon in a hit (or just at the start of the hit), check  
the lexicon generation and reload if needed?

This approach is simpler than futzing around with process management,  
simpler than messing with multiple signals, simpler to scale to n  
boxen (just use memcache - can change this by config if you're using  
Catalyst::Plugin::Cache), etc...

Cheers
t0m






More information about the Catalyst mailing list