Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for Minion worker to be started by the application server #76

Open
kraih opened this issue Dec 15, 2018 · 5 comments
Open

Allow for Minion worker to be started by the application server #76

kraih opened this issue Dec 15, 2018 · 5 comments

Comments

@kraih
Copy link
Member

kraih commented Dec 15, 2018

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.

@s1037989
Copy link

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.

@kraih kraih pinned this issue Dec 15, 2018
@tryorfry
Copy link

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

@s1037989
Copy link

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?

@iamalnewkirk
Copy link

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?

@simonecesano
Copy link

simonecesano commented Jan 10, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants