resque-delayed
resque-delayed copied to clipboard
redis-namespace support
Would be nice. I run a couple apps using that in order for queues not to conflict.
Good point. I'll look into it.
Okay. I think the correct thing to do is to piggyback on Resque.redis.namespace
and use the same namespace for resque-delayed's queue. I assume that you are using resque namespaces if you are running multiple apps on the same Redis instance.
The fix for this is trivial, but an upgrade to support namespaces will orphan existing queues if users aren't aware of it. I was going to just have resque-delayed issue a warning if it found a Resque::Delayed:internal
key (which is the internal name of the queue) in the connected Redis instance but maybe that's not strong enough. Is it unreasonable to raise an exception advising users that they have to run the provided migrate task to rename their queue?
I guess those people using resque-delayed right now are also not using redis-namespace so their queue name would remain the same "Resque::Delayed::internal"? If that's the case you don't really need a warning as I see it. If I'm wrong about that I don't think it's unreasonable to raise.
Well, the queue name will be "Resque::Delayed::internal"
for anyone using resque-delayed right now, even those who have a namespace set with resque. Also, you don't have to use redis-namespace explicitly in order to have a namespace with resque--if you use a hostname:port/namespace
string in your resque config it will take the namespace from there. What are you using for namespacing?
Ah I see.
I'm using redis-namespace.
Yeah, resque will internally create a Redis::Namespace
instance if you pass it a namespace via config or you can alternately pass in a Redis::Namespace
instance directly that will get used instead.