Getting auto_reload to work
Hi Folks, I am trying to get my dancer app to restart/reload any time I change a module in my lib directory. I've set auto_reload to 1 in config.yml and have Module::Refresh and Clone modules installed but nothing seems to happen when I make a change to a module in the lib folder and I have to manually restart for my changes to take effect. I am on Perl 5.10.1 and Dancer 1.2002 running on Mac OS 10.6.5. What am I doing wrong? I realize that auto_reload isn't meant for production use, but it'd be nice to have my changes loaded automatically on my dev box. Thanks, Deepak
On Thu, Dec 16, 2010 at 11:38 AM, Deepak Gulati <deepak.gulati@gmail.com> wrote:
Hi Folks,
I am trying to get my dancer app to restart/reload any time I change a module in my lib directory. I've set auto_reload to 1 in config.yml and have Module::Refresh and Clone modules installed but nothing seems to happen when I make a change to a module in the lib folder and I have to manually restart for my changes to take effect. I am on Perl 5.10.1 and Dancer 1.2002 running on Mac OS 10.6.5.
What am I doing wrong?
I realize that auto_reload isn't meant for production use, but it'd be nice to have my changes loaded automatically on my dev box.
Thanks, Deepak _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
The auto_reload option is being deprecated and will be removed in future versions. What I do to achieve auto reload is simple by running my app via CGI. This is very easy. If you have created a scaffolded app via the command dancer -a MyApp for example, then it will create a dispatch.cgi script for you in the public folder. To run via CGI, you just need to tell your web server about it. All it takes is something like this: cd /var/www/cgi-bin ln -s /path/to/MyApp/public/dispatch.cgi myapp.cgi The path to your system's cgi-bin folder may be different, but that is the basic idea. Then each time you hit http://localhost/cgi-bin/myapp.cgi, it will reload all the modules. - Naveed Massjouni
Interesting! I like the way you turned necessity (that a webserver must teardown and reload everything when running a CGI script) into a virtue :). That said, I was still running using the command line - perl bin/app.pl - which uses the built-in dev server. Is there a way to make auto_reload - or for that matter any other mechanism that restarts my app upon change in a module. On Fri, Dec 17, 2010 at 1:58 AM, Naveed Massjouni <naveedm9@gmail.com> wrote:
On Thu, Dec 16, 2010 at 11:38 AM, Deepak Gulati <deepak.gulati@gmail.com> wrote:
Hi Folks,
I am trying to get my dancer app to restart/reload any time I change a module in my lib directory. I've set auto_reload to 1 in config.yml and have Module::Refresh and Clone modules installed but nothing seems to happen when I make a change to a module in the lib folder and I have to manually restart for my changes to take effect. I am on Perl 5.10.1 and Dancer 1.2002 running on Mac OS 10.6.5.
What am I doing wrong?
I realize that auto_reload isn't meant for production use, but it'd be nice to have my changes loaded automatically on my dev box.
Thanks, Deepak _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
The auto_reload option is being deprecated and will be removed in future versions. What I do to achieve auto reload is simple by running my app via CGI. This is very easy. If you have created a scaffolded app via the command dancer -a MyApp for example, then it will create a dispatch.cgi script for you in the public folder. To run via CGI, you just need to tell your web server about it. All it takes is something like this:
cd /var/www/cgi-bin ln -s /path/to/MyApp/public/dispatch.cgi myapp.cgi
The path to your system's cgi-bin folder may be different, but that is the basic idea. Then each time you hit http://localhost/cgi-bin/myapp.cgi, it will reload all the modules.
- Naveed Massjouni _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
On Thu, Dec 16, 2010 at 23:28, Naveed Massjouni <naveedm9@gmail.com> wrote:
On Thu, Dec 16, 2010 at 11:38 AM, Deepak Gulati <deepak.gulati@gmail.com> wrote:
I realize that auto_reload isn't meant for production use, but it'd be nice to have my changes loaded automatically on my dev box.
The auto_reload option is being deprecated and will be removed in future versions. What I do to achieve auto reload is simple by
Why is it being deprecated?
running my app via CGI. This is very easy. If you have created a scaffolded app via the command dancer -a MyApp for example, then it will create a dispatch.cgi script for you in the public folder. To
No, thanks, I have long removed all remnants of Apache. Is it really a recommended way to develop?
run via CGI, you just need to tell your web server about it. All it takes is something like this:
Le 17/12/2010 11:38, Anton Ukolov a écrit :
The auto_reload option is being deprecated and will be removed in future versions.
Why? I am being sad when reading this.
What will be replaced for this feature?
Well, the way it's done currently is bad, and almost never worked. So, we're going to deprecate it from the core, in order to rethink it in the future, maybe as a plugin, or with a specific Dancer::Handler. I don't know yet. If someone wants to work on that it's welcome ;) -- Alexis Sukrieh
On Fri, Dec 17, 2010 at 11:52 AM, Alexis Sukrieh <sukria@sukria.net> wrote:
Le 17/12/2010 11:38, Anton Ukolov a écrit :
The auto_reload option is being deprecated and will be removed in
future versions.
Why? I am being sad when reading this.
What will be replaced for this feature?
Well, the way it's done currently is bad, and almost never worked.
and there is a huge memory leak when using this feature.
On Fri, Dec 17, 2010 at 16:00, franck <franck@lumberjaph.net> wrote:
The auto_reload option is being deprecated and will be removed in
future versions.
Why? I am being sad when reading this.
What will be replaced for this feature?
Well, the way it's done currently is bad, and almost never worked.
and there is a huge memory leak when using this feature.
Not a problem during development.
On Sat, Dec 18, 2010 at 01:07, Alex Kapranoff <kapranoff@gmail.com> wrote:
On Fri, Dec 17, 2010 at 16:00, franck <franck@lumberjaph.net> wrote:
The auto_reload option is being deprecated and will be removed in future versions.
Why? I am being sad when reading this.
What will be replaced for this feature?
Well, the way it's done currently is bad, and almost never worked.
and there is a huge memory leak when using this feature.
Not a problem during development.
FWIW, if I needed something like this I would use Plackup and - if necessary - the "Shotgun" reloader to achieve the same results, using the "is a PSGI" feature of Dancer. ] plackup -L Shotgun ... myapp Which should do what you want without the Dancer folks having to maintain it. (I always go check if there is a Plack way to achieve something like that, because it is then portable to other frameworks as well.) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons
On Fri, Dec 17, 2010 at 7:33 PM, Daniel Pittman <daniel@rimspace.net> wrote:
On Sat, Dec 18, 2010 at 01:07, Alex Kapranoff <kapranoff@gmail.com> wrote:
On Fri, Dec 17, 2010 at 16:00, franck <franck@lumberjaph.net> wrote:
The auto_reload option is being deprecated and will be removed in future versions.
Why? I am being sad when reading this.
What will be replaced for this feature?
Well, the way it's done currently is bad, and almost never worked.
and there is a huge memory leak when using this feature.
Not a problem during development.
FWIW, if I needed something like this I would use Plackup and - if necessary - the "Shotgun" reloader to achieve the same results, using the "is a PSGI" feature of Dancer.
] plackup -L Shotgun ... myapp
This sounds like a great idea. We should document this in the pod as an alternative to using the auto_reload setting. -Naveed
Which should do what you want without the Dancer folks having to maintain it. (I always go check if there is a Plack way to achieve something like that, because it is then portable to other frameworks as well.)
Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
Hi,
FWIW, if I needed something like this I would use Plackup and - if necessary - the "Shotgun" reloader to achieve the same results, using the "is a PSGI" feature of Dancer.
] plackup -L Shotgun ... myapp
This sounds like a great idea. We should document this in the pod as an alternative to using the auto_reload setting. -Naveed
Yes, this is totally the kind of feature that we - the Dancer team - should avoid spending time on. Deprecating auto_reload in 1.3 + documenting plackup + Shotgun seems to me a very good way to resolve this issue. Thanks for the investigation ;) -- Alexis Sukrieh
On Sun, Dec 19, 2010 at 21:46, Alexis Sukrieh <sukria@sukria.net> wrote:
FWIW, if I needed something like this I would use Plackup and - if necessary - the "Shotgun" reloader to achieve the same results, using the "is a PSGI" feature of Dancer.
] plackup -L Shotgun ... myapp
This sounds like a great idea. We should document this in the pod as an alternative to using the auto_reload setting. -Naveed
Yes, this is totally the kind of feature that we - the Dancer team - should avoid spending time on.
Deprecating auto_reload in 1.3 + documenting plackup + Shotgun seems to me a very good way to resolve this issue.
Most apps shouldn't need the very heavy-weight Shotgun loader, FWIW. Anyway, pointing to the right section of the Plack manual pages should be sufficient to answer that. :) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons
FWIW, if I needed something like this I would use Plackup and - if necessary - the "Shotgun" reloader to achieve the same results, using the "is a PSGI" feature of Dancer.
] plackup -L Shotgun ... myapp
Which should do what you want without the Dancer folks having to maintain it. (I always go check if there is a Plack way to achieve something like that, because it is then portable to other frameworks as well.)
Thanks Daniel! This does exactly what I am looking for. And +1 for Naveed's suggestion that this be included in the pod (at least in the cookbook).
Hi, On Thu, Dec 16, 2010 at 6:38 PM, Deepak Gulati <deepak.gulati@gmail.com>wrote:
What am I doing wrong?
I don't know. Gabor has presented his PEG application and we've turned on auto_reload during the talk and saw it working live. So, I know it does work. Referring (belated) to the rest of the thread, auto_reload wasn't official deprecated. We have officially stopped maintaining the feature. That means that we don't debug it or work on it anymore. Beyond a serious memory leak, we've found it a serious pain to maintain. Apparently it has been completely removed in other frameworks we've looked at. The overall tone was "let's put this in a plugin instead". No one has wrote the plugin yet (since apparently no one had such a serious itch), but we've yet to remove this functionality and it should work. At least in my recent experience. Sawyer.
participants (8)
-
Alex Kapranoff -
Alexis Sukrieh -
Anton Ukolov -
Daniel Pittman -
Deepak Gulati -
franck -
Naveed Massjouni -
sawyer x