Hi *,
we're working on an app with some extensive config data which also needs
some preprocessing (merging defaults etc.) to become usable.
We use a plugin ("register" method) to initialise a config object on app
start and keep it around, as recreating the config on every incoming
request would be to costly.
However, the config data - held in a few MongoDB documents - might be
updated anytime via scripts and/or a web admin GUI and it would be expected
that these changes take effect immediately (or at least within a short time
frame).
On the other hand the number of updates is expected to be fairly low;
perhaps 50 times per day.
So we need to find an effective way to trigger a recreation of the config
object in all Hypnotoad child processes.
I can see a few options for that; e.g.
- simply restarting the hypnotoad, or
- adding a periodic timer to the IOLoop which checks for an updated config
databases or
- starting a MongoDB (Mango) query on app start which uses a tailable
cursor and thus returns once the databases is updated.
And there's probably a ton of other options I did not mention, too.
I'm especially interested in recommendations based on real life
experience...
Thanks!
Heiko
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.