librelist archives

« back to archive

Spin up a worker to listen on a namespaced queue

Spin up a worker to listen on a namespaced queue

From:
Josiah Kiehl
Date:
2011-08-10 @ 22:22
I posted a question on StackOverflow, but this list might get me a speedier
answer.


http://stackoverflow.com/questions/7018468/resque-worker-doesnt-pick-up-tasks-when-using-a-namespace

Quoted below:

I'm using Resque:pubsub, which, by default, places tasks in the namespace
resque:pubsub.

I cannot get a worker to use the namespaced queues for some reason.

I can see the queued tasks on resque-web -N resque:pubsub, but spinning up a
worker withQUEUES=* RESQUE_NAMESPACE="resque:pubsub" rake environment
resque:work does not increment the available worker count on resque-web nor
does the worker pick up tasks from that namespace.

Any idea what I'm missing? If I tell resque:pubsub to use the default
namespace, and spin up a worker without specifying RESQUE_NAMESPACE,
everything works fine. Because I use resque for other purposes in my
application, I don't want the pubsub queues to clash, so I do want to use
the resque:pubsub namespace.

Re: [resque] Spin up a worker to listen on a namespaced queue

From:
Karl Baum
Date:
2011-08-11 @ 00:56
I set the namespace in a rails initializer with:

Resque.redis.namespace = "resque:pubsub"

Hope that helps!


On Aug 10, 2011, at 6:22 PM, Josiah Kiehl wrote:

> I posted a question on StackOverflow, but this list might get me a 
speedier answer.
> 
> 
http://stackoverflow.com/questions/7018468/resque-worker-doesnt-pick-up-tasks-when-using-a-namespace
> 
> Quoted below:
> 
> I'm using Resque:pubsub, which, by default, places tasks in the 
namespace resque:pubsub.
> 
> I cannot get a worker to use the namespaced queues for some reason.
> 
> I can see the queued tasks on resque-web -N resque:pubsub, but spinning 
up a worker withQUEUES=* RESQUE_NAMESPACE="resque:pubsub" rake environment
resque:work does not increment the available worker count on resque-web 
nor does the worker pick up tasks from that namespace.
> 
> Any idea what I'm missing? If I tell resque:pubsub to use the default 
namespace, and spin up a worker without specifying RESQUE_NAMESPACE, 
everything works fine. Because I use resque for other purposes in my 
application, I don't want the pubsub queues to clash, so I do want to use 
the resque:pubsub namespace.
> 
> 

Re: [resque] Spin up a worker to listen on a namespaced queue

From:
Josiah Kiehl
Date:
2011-08-11 @ 01:17
The queues are being created with the proper namespace, but the worker is
not using it. I need to be able to spin up workers under both the default
namespace and the resque:pubsub namespace. Will using an initializer let me
do that?

Thanks for the help!

On Wed, Aug 10, 2011 at 5:56 PM, Karl Baum <karl.baum@gmail.com> wrote:

> I set the namespace in a rails initializer with:
>
> Resque.redis.namespace = "resque:pubsub"
>
> Hope that helps!
>
>
> On Aug 10, 2011, at 6:22 PM, Josiah Kiehl wrote:
>
> I posted a question on StackOverflow, but this list might get me a speedier
> answer.
>
>
> 
http://stackoverflow.com/questions/7018468/resque-worker-doesnt-pick-up-tasks-when-using-a-namespace
>
> Quoted below:
>
> I'm using Resque:pubsub, which, by default, places tasks in the namespace
> resque:pubsub.
>
> I cannot get a worker to use the namespaced queues for some reason.
>
> I can see the queued tasks on resque-web -N resque:pubsub, but spinning up
> a worker withQUEUES=* RESQUE_NAMESPACE="resque:pubsub" rake environment
> resque:work does not increment the available worker count on resque-web nor
> does the worker pick up tasks from that namespace.
>
> Any idea what I'm missing? If I tell resque:pubsub to use the default
> namespace, and spin up a worker without specifying RESQUE_NAMESPACE,
> everything works fine. Because I use resque for other purposes in my
> application, I don't want the pubsub queues to clash, so I do want to use
> the resque:pubsub namespace.
>
>
>
>

Re: [resque] Spin up a worker to listen on a namespaced queue

From:
Karl Baum
Date:
2011-08-11 @ 12:48
I don't know of an env variable that allows for this out of box with 
resque but you can certainly reference a name space within your 
initializer.

Resque.redis.namespame=ENV['RESQUE_NAMESPACE'] if ENV['RESQUE_NAMESPACE']

Let me if that makes sense.

thx!

On Aug 10, 2011, at 9:17 PM, Josiah Kiehl wrote:

> The queues are being created with the proper namespace, but the worker 
is not using it. I need to be able to spin up workers under both the 
default namespace and the resque:pubsub namespace. Will using an 
initializer let me do that?
> 
> Thanks for the help!
> 
> On Wed, Aug 10, 2011 at 5:56 PM, Karl Baum <karl.baum@gmail.com> wrote:
> I set the namespace in a rails initializer with:
> 
> Resque.redis.namespace = "resque:pubsub"
> 
> Hope that helps!
> 
> 
> On Aug 10, 2011, at 6:22 PM, Josiah Kiehl wrote:
> 
>> I posted a question on StackOverflow, but this list might get me a 
speedier answer.
>> 
>> 
http://stackoverflow.com/questions/7018468/resque-worker-doesnt-pick-up-tasks-when-using-a-namespace
>> 
>> Quoted below:
>> 
>> I'm using Resque:pubsub, which, by default, places tasks in the 
namespace resque:pubsub.
>> 
>> I cannot get a worker to use the namespaced queues for some reason.
>> 
>> I can see the queued tasks on resque-web -N resque:pubsub, but spinning
up a worker withQUEUES=* RESQUE_NAMESPACE="resque:pubsub" rake environment
resque:work does not increment the available worker count on resque-web 
nor does the worker pick up tasks from that namespace.
>> 
>> Any idea what I'm missing? If I tell resque:pubsub to use the default 
namespace, and spin up a worker without specifying RESQUE_NAMESPACE, 
everything works fine. Because I use resque for other purposes in my 
application, I don't want the pubsub queues to clash, so I do want to use 
the resque:pubsub namespace.
>> 
>> 
> 
> 

Re: [resque] Spin up a worker to listen on a namespaced queue

From:
Josiah Kiehl
Date:
2011-08-11 @ 17:34
Thank you very much, this worked perfectly.

I realize now that I missed the note about the initializer in the README on
resque:pubsub
https://github.com/RevolutionPrep/resque-pubsub

Thanks again!
Josiah

On Thu, Aug 11, 2011 at 5:48 AM, Karl Baum <karl.baum@gmail.com> wrote:

> I don't know of an env variable that allows for this out of box with resque
> but you can certainly reference a name space within your initializer.
>
> Resque.redis.namespame=ENV['RESQUE_NAMESPACE'] if ENV['RESQUE_NAMESPACE']
>
> Let me if that makes sense.
>
> thx!
>
>
> On Aug 10, 2011, at 9:17 PM, Josiah Kiehl wrote:
>
> The queues are being created with the proper namespace, but the worker is
> not using it. I need to be able to spin up workers under both the default
> namespace and the resque:pubsub namespace. Will using an initializer let me
> do that?
>
> Thanks for the help!
>
> On Wed, Aug 10, 2011 at 5:56 PM, Karl Baum <karl.baum@gmail.com> wrote:
>
>> I set the namespace in a rails initializer with:
>>
>> Resque.redis.namespace = "resque:pubsub"
>>
>> Hope that helps!
>>
>>
>> On Aug 10, 2011, at 6:22 PM, Josiah Kiehl wrote:
>>
>> I posted a question on StackOverflow, but this list might get me a
>> speedier answer.
>>
>>
>> 
http://stackoverflow.com/questions/7018468/resque-worker-doesnt-pick-up-tasks-when-using-a-namespace
>>
>> Quoted below:
>>
>> I'm using Resque:pubsub, which, by default, places tasks in the namespace
>> resque:pubsub.
>>
>> I cannot get a worker to use the namespaced queues for some reason.
>>
>> I can see the queued tasks on resque-web -N resque:pubsub, but spinning
>> up a worker withQUEUES=* RESQUE_NAMESPACE="resque:pubsub" rake
>> environment resque:work does not increment the available worker count on
>> resque-web nor does the worker pick up tasks from that namespace.
>>
>> Any idea what I'm missing? If I tell resque:pubsub to use the default
>> namespace, and spin up a worker without specifying RESQUE_NAMESPACE,
>> everything works fine. Because I use resque for other purposes in my
>> application, I don't want the pubsub queues to clash, so I do want to use
>> the resque:pubsub namespace.
>>
>>
>>
>>
>
>