Fresque
Fresque copied to clipboard
Specifying worker names with stop command
I am going to implement a feature that allows users to specify the worker to kill in command line. This is useful if you are using some automation/CI tools (jenkins, ansible, puppet etc). There are going to be two additional options to the stop command: --worker
and --count
.
The --worker
option allows you to specify a queue name to kill. By default it will kill all workers with that name.
The --count
option works in tandem with the --worker
option and allows you to specify how many to kill.
I'm not sure if you accept feature additions to your codebase, but if you want, I can make a pull request, implement it and then merge back into your repo. That way others can benefit.
Let me know what you think
I don't quite get what you're trying to do. The stop
command already print a list of workers, and you can choose the worker you want to stop.
I think there's naming issue, but are you trying to stop a worker, by the name of the polled queue ? In that case, a --queue
option would make more sense.
Sorry, I mean't --queue
(been working very long hours as of late so am tripping up all over the place). It does print a list of workers, but then it requires stdin
input and that's a problem if you are using automation tools.
Take my configuration for example, we have a jenkins project which allows you to specify queues to start
. I make a selection and it plugs the variables into a bash script and runs it. You can't do the same with the stop
command and I don't want junior devs having access to our queuing servers. At the moment, the only solution we have is to kill all the workers which is high inconvenient.
fresque stop --queue my_queue --count 2 // that will kill two workers from my_queue
fresque stop --queue my_queue // that will kill all workers from my_queue
Interesting feature, :+1:
cool, I'll make a PR tomorrow then :)