99designs / cmdstalk

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

Wildcard tube matching (incl new tubes) #1

Open lwc opened 10 years ago

lwc commented 10 years ago

One drawback to our current docker setup is that services like mysql and beanstalk are not isolated between 99designs services (contests / swiftly etc).

This issue doesn't manifest for mysql, as (most) applications are isolated from each other at a database level. Unfortunately it does manifest for beanstalk, as cmdstalk, when run with -all will happily listen to queues from all applications.

While this problem is better addressed at a docker level, one feature that would alleviate this in the short term is wildcard tube matching.

Something like the following could listen to all present and future tubes starting with "contests": `cmdstalk -cmd="/path/to/your/worker --your=flags --here" -tubes="contests*"`

Happy to pair with someone on it, for the go experience.

pda commented 10 years ago

Yep — @harto and I were just discussing an idea like this yesterday.

I think I'd prefer matching on prefix rather than wildcard. It suits the use-case you've described without posing unnecessary questions like what does -tubes="contests**-hello-*" mean, and avoids cmdstalk competing with the shell to expand * chars.

lwc commented 10 years ago

Seems fair enough, prefix matching would solve my problem :+1:

joho commented 10 years ago

:+1: to prefixing