[Catalyst] rewrite or reload on YAML

Nathaniel Nuss ogmoid at gmail.com
Mon Dec 25 22:30:54 GMT 2006


On Fri, Dec 22, 2006 at 01:39:47PM -0600, Brandon Black wrote:
> On 12/22/06, Wan <wanmyome at gmail.com> wrote:
> >I will run myapp on mod_perl or FastCGI, but I want to know how to
> >rewrite or reload my YAML file.
> >
> >for example
> >
> ># myapp has this line
> >$c->config->{SomeKey} = 'SomeValue';
> >
> >.....
> >
> >How can save this value to my YAML file, and how can I reload this value.
> >I don't want restart my web server. Before Catalyst I usually save the
> >values
> >to a file and reload the values myself.
> >
> >I'm a beginner of YAML and Catalyst.
> >
> 
> Probably the best way to handle volatile configuration data would be
> to put those values in a database rather than in your yaml config, and
> use them via your database model.

This is what we're being lead to do. In order to stay ahead of our $client =
\$ceo we're allowing for complex (cascading) user/group hierarchies. Some
deployments will use this more - some less or barely at all. The purpose of
these user/groups will primarily be to define user-available resources on the
site but could be (ab)used for other purposes if the need arose.

If that ^^^^ ever degrades into the worst case - and when doesn't it? ;) - I'm
thinking I'll want to stash a digested permission/limit blob/object/hash into
the users' session (maybe at every login). We haven't yet made extensive use
of the sessions and I'm wondering if doing that may over bloat the sessions,
potentially causing problems I haven't thought of yet? ;)

We decided to use the same schema to define the global user/group
permission/limit as well and have Catalyst digest and load that during startup
(and can refresh it while-we're-running). I would like to know if anyone has a
good scheme to make sure all mod-perl instances refresh? (our production env)
These global settings should change slowly enough that I can probably accept a
full server restart but, obviously, would prefer not.

Thanks for any thoughts.

-- 
Nate Nuss



More information about the Catalyst mailing list