You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The motivation for this is mojolicious/minion#76. But there are many other use cases for running arbitrary code in a persistent helper process next to the Mojolicious application server.
While forking such a process from a before_server_start hook is fairly trivial, making it work with Mojo::Server::Daemon as well as Mojo::Server::Prefork is not. Especially stopping the process together with the main application server process is tricky. It will have to work with Mojo::Server::Morbo and Mojo::Server::Hypnotoad too. There also needs to be some way to handle failures in the helper process (at the very least logging the exit code/signal as an error). And multiple helper processes should not interfere with each other of course.
API wise, we don't need anything fancy, a simple plugin should do just fine for now.
plugin HelperProcess => {run => sub ($app) {
while (1) {
sleep 1;
$app->log->debug("Helper process $$ is still running");
}
}};
Process management is the main priority and needs to be rock solid. With very good test coverage.
The text was updated successfully, but these errors were encountered:
I've been thinking a bit more about this feature, and actually most real deployments are just prefork these days. And prefork already has process management features (for the workers) we could expand to include helper processes. The only real blocker here is morbo, which needs the feature for development and uses daemon. Perhaps we could switch morbo to prefork and sidestep the problem that way?
The motivation for this is mojolicious/minion#76. But there are many other use cases for running arbitrary code in a persistent helper process next to the Mojolicious application server.
While forking such a process from a
before_server_start
hook is fairly trivial, making it work withMojo::Server::Daemon
as well asMojo::Server::Prefork
is not. Especially stopping the process together with the main application server process is tricky. It will have to work withMojo::Server::Morbo
andMojo::Server::Hypnotoad
too. There also needs to be some way to handle failures in the helper process (at the very least logging the exit code/signal as an error). And multiple helper processes should not interfere with each other of course.API wise, we don't need anything fancy, a simple plugin should do just fine for now.
Process management is the main priority and needs to be rock solid. With very good test coverage.
The text was updated successfully, but these errors were encountered: