rails / activejob

Declare job classes that can be run by a variety of queueing backends
743 stars 47 forks source link

Setting resque queue adapter fails #97

Closed hutchisonc closed 10 years ago

hutchisonc commented 10 years ago

When I set resque for the queue adapter, I get the error

cannot load such file -- resque_scheduler (LoadError)
seuros commented 10 years ago

Add gem 'resque-scheduler' to your gemfile

resque don't accept scheduled jobs by default apparently.

hutchisonc commented 10 years ago

I have gem 'resque-scheduler' in my gemfile when the error is occurring. I'm not sure, but I think the require line in the adapter may need to be changed from require 'resque-scheduler' to require 'resque/scheduler'

seuros commented 10 years ago

require 'resque-scheduler' is correct https://github.com/resque/resque-scheduler/tree/master/lib Try to place resque-scheduler before activejob in the Gemfile.

hutchisonc commented 10 years ago

Same error as before.

seuros commented 10 years ago

I don't use resque, but i will install it to fix this issue.

seuros commented 10 years ago

@glenwayguy can you try with my fork in resque branch ?

hutchisonc commented 10 years ago

That worked! Thanks.

seuros commented 10 years ago

@glenwayguy are you using the github version of resque-scheduler ? It seem that the rubygems version still use require the old 'resque_scheduler'

cristianbica commented 10 years ago

Maybe we should make enqueue_in/at optional: try to require the file and rescue and in enqueue_in/at check if the adapter responds to the enqueue later method. What do you guys think?-- Cristian Bica

On Thu, Jul 3, 2014 at 7:41 PM, Abdelkader Boudih notifications@github.com wrote:

@glenwayguy are you using the github version of resque-scheduler ?

It seem that the rubygems version still use require the old 'resque_scheduler'

Reply to this email directly or view it on GitHub: https://github.com/rails/activejob/issues/97#issuecomment-47954218

seuros commented 10 years ago

That will make the code dirty. Since the scheduler is owned by the same org, we don't have to worry about compatibility.

cristianbica commented 10 years ago

From the research we did I see that 2 adapters have the later functionality in a gem. For those we shouldn't force users to load both gems if they don't use the later functionality-- Cristian Bica

On Thu, Jul 3, 2014 at 9:15 PM, Abdelkader Boudih notifications@github.com wrote:

That will make the code dirty. Since the scheduler is owned by the same org, we don't have to worry about compatibility.

Reply to this email directly or view it on GitHub: https://github.com/rails/activejob/issues/97#issuecomment-47965551

seuros commented 10 years ago

I agree, maybe we should add a :resque_generic without the later extension or resque_scheduler with the later extension and remove the extension from the :resque .

Don't forget that we will have to add :resque2 later