mojolicious/minion

Allow for Minion worker to be started by the application server

kraih opened this issue · 5 comments

kraih commented

This gets requested very commonly. It would be nice if Mojolicious::Plugin::Minion
had the ability to start a Minion worker together with the application server (daemon and prefork). And it would be especially nice if it worked with Morbo automatic restarting during development.

OH MY GOSH PLEASE!! 💃

I started to build my own plugin to handle this, but it isn't near as good, lacks tests, and lacks documentation and not near as good as being built in.

Thank you, happy, await for this ability. I was searching for this ability:
minion worker doesn't start automatically - stackoverflow

I just noticed the dev_server branch from last June, well before this issue was opened. This looks to be what we're looking for, yes? If so, what still needs to be done to get this accepted? Or is this not a wise / sufficient approach?

My approach to this problem, with native support, would be to employ something like Proclet (process manager, similar to Ruby Foreman).

Obviously, this wouldn't work with Morbo automatic restarting automatically but solves the problem and in-fact creates additional flexibility.

Thinking about this made me wonder whether the Mojo suite of tools should have it's own Foreman, NPM (i.e. npm start), multi-process manager. Maybe this ticket should actually be a separate project?

Just for kick I tried spawning a worker with Mojo::IOLoop::Subprocess and it worked ok - code here.

It seems to a viable solution, and it restarts with morbo - am I too naive to see the drawbacks?

EDIT: ok - found it: this only spawns additional processes - it never kills the old one...

EDIT: found a way to reap the zombie processes using Proc::ProcessTable - gist here

I do appreciate comments, feedback. By the way - thanks, Mojolicious has been a favourite of mine for a long long time, and it's a never ending source of awe and fun.