The docs say that I should be able to just do QC::Worker.new.start to fire up a consumer, but that fails b/c Worker.new requires 5 args.
Having the 5 args all in order with no defaults didn't seem very maintainable, so here's a patch to make it accept an options hash, e.g.:
QC::Worker.new(q_name: 'thingers', top_bound: 3, fork_worker: true, listening_worker: true, max_attempts: 5)
…or to use some defaults:
QC::Worker.new(q_name: 'thingers', listening_worker: true)
…or to use all defaults:
It also still works with the original 5-argument scheme, for backwards compatibility.
What do you think? I'm new to the code, so I may be missing something. Feel free to reject the pull request if this doesn't actually make sense.
Changed Worker.new to accept an options hash (with all values optiona…
…l), or no args at all (to make everything default).
Yes! @mfine and I were just talking about how the args to the worker are a bit cumbersome. This patch solves a real problem. Thanks for taking care of this.
You bet. Glad it helps!