minion icon indicating copy to clipboard operation
minion copied to clipboard

Allow for Minion worker to be started by the application server

Open kraih opened this issue 7 years ago • 5 comments

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.

kraih avatar Dec 15 '18 17:12 kraih

OH MY GOSH PLEASE!! :dancer:

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.

s1037989 avatar Dec 15 '18 18:12 s1037989

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

tryorfry avatar Dec 16 '18 02:12 tryorfry

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?

s1037989 avatar Feb 23 '19 02:02 s1037989

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?

iamalnewkirk avatar Mar 18 '19 22:03 iamalnewkirk

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.

simonecesano avatar Jan 10 '21 22:01 simonecesano