99designs / cmdstalk

beanstalkd broker; run jobs as unix commands.
http://godoc.org/github.com/99designs/cmdstalk
MIT License
75 stars 15 forks source link

fea: support job count limit #9

Open JensRantil opened 6 years ago

JensRantil commented 6 years ago

Use case: I have 100k items I'd like to process when my system is under low load. By submitting 100 batch[1] jobs doing

cmdstalk -cmd=my-script.sh -max-jobs 1000

I know processing will halt as soon as load is above 0.8 (or whatever batch is configured to).

[1] https://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-autotasks-at-batch.html

JensRantil commented 6 years ago

This PR is based off of #8. Let me know if you'd like me to rebase on top of master once #8 has been merged.