Better argument structure for #54

merged 1 commit into from Mar 28, 2012


None yet

2 participants


The docs say that I should be able to just do to fire up a consumer, but that fails b/c 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.: 'thingers', top_bound: 3, fork_worker: true, listening_worker: true, max_attempts: 5)

…or to use some defaults: '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.

@pcantrell pcantrell Changed 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.

@ryandotsmith ryandotsmith merged commit b4723ab into QueueClassic:master Mar 28, 2012

You bet. Glad it helps!

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