brianlmoon/GearmanManager — Issue #29: Auto add new workers, remove deleted ones.
Author: PureForm
Created: 2011-11-24 05:32:30+00:00
State: open

One thing which would be incredibly useful is for GearmanManager to detect new / deleted worker files.

I noticed you mentioned it being bad practice, but any downsides could be avoided by simply being mindful of new and deleted jobs ones. Letting us shoot ourselves in the foot, that is :-)

I have been working on this for a few hours today and have cobbled together something which nearly works.

Having the helper process detect new / deleted files was simple, but getting the parent process to handle new children has been a challenge.

What I have yet to fix is the parent restarting the children processes [in process_loop()] as well as it not being able to kill orphaned processes when I stop the daemon... they just keep running.

Diff: http://www.pureformsolutions.com/tmp/GearmanManager.diff
Full script: http://www.pureformsolutions.com/tmp/GearmanManager.phps

Any help / direction would be great appreciated.

Also, thanks for such a great tool!

Chris-