Hiho dear Mojo folks,
This is my first post here, so I'd like to start with a big thank you all
for the work put on mojolicious. It just rocks. :-)
I am building a full (not light) app which needs access to a set of
variables (say config) stored in a dedicated module (MyApp::Model::Config).
These values do change during the run, and I want all the workers to access
the new values. This works very well in morbo, but as soon as I start using
hypnotoad the values are not updated for all workers. As a consequence,
depending on the worker serving your request you get either old or new
values randomly.
I started with a singleton helper put directly in the startup method:
$app->helper( repo => sub { state $config = MyApp::Model::Config->new($app) } );
This doesn't resolve the issue.
Then I read about similar problems with db connection handles, and I
decided to move them out of the startup method and I added some has
attributes, still in the MyApp.pl class:
has my_config => sub { state $config = MyApp::Model::Config->new($app); };
But it still doesn't work.
So, how should I do that? Any advice on the design or code itself is
welcome...
Thanks in advance,
--
Boris
--
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 http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.