librelist archives

« back to archive

Putting jobs into a queue using only string or symbols

Putting jobs into a queue using only string or symbols

From:
Tim Uckun
Date:
2011-01-17 @ 09:04
I want to put jobs into the queue without making references to the
classes themselves (because I don't want to load the rails env for job
submitters).

I looked at the code and figured out that this does work

Resque.push("keyword_feeder", :class => "Worker::Processors::Keyword",
:args => nil)

I just want to make sure I am not shooting myself in the foot with
this. Is there anything wrong with what I am doing?

Also is there shorter cut where you don't have to specify both the
queue name and the class name?

Re: [resque] Putting jobs into a queue using only string or symbols

From:
Karl Baum
Date:
2011-01-17 @ 11:13
I do this using:

 Resque::Job.create('some_queue', 'SomeClass', some_argument)


On Jan 17, 2011, at 4:04 AM, Tim Uckun wrote:

> I want to put jobs into the queue without making references to the
> classes themselves (because I don't want to load the rails env for job
> submitters).
> 
> I looked at the code and figured out that this does work
> 
> Resque.push("keyword_feeder", :class => "Worker::Processors::Keyword",
> :args => nil)
> 
> I just want to make sure I am not shooting myself in the foot with
> this. Is there anything wrong with what I am doing?
> 
> Also is there shorter cut where you don't have to specify both the
> queue name and the class name?

Re: [resque] Putting jobs into a queue using only string or symbols

From:
Tim Uckun
Date:
2011-01-17 @ 12:02
On Tue, Jan 18, 2011 at 12:13 AM, Karl Baum <karl.baum@gmail.com> wrote:
> I do this using:
>
>  Resque::Job.create('some_queue', 'SomeClass', some_argument)

It looks like that's a better way to go