Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error undefined method `perform' with ActiveJob::Base #124

Open
redseafan opened this issue Oct 11, 2022 · 1 comment
Open

Error undefined method `perform' with ActiveJob::Base #124

redseafan opened this issue Oct 11, 2022 · 1 comment

Comments

@redseafan
Copy link

Hi,
I have been trying to implement resque-unique_by_arity in our rails application.
As per the readme I have configured the gem after the perform class method

class MyUniqueJob < ActiveJob::Base
  queue_as :default

  def perform(args)
    # perform method here
  end

  include Resque::Plugins::UniqueByArity.new(
    arity_for_uniqueness: 1,
    unique_at_runtime: true,
    unique_in_queue: true
  )
end

I still get the error undefined method `perform' for class `#<Class:MyUniqueJob>'
Is this gem compatible with ActiveJob?
Thanks!

@pboling
Copy link
Member

pboling commented Nov 7, 2023

Hi @redseafan - that is a very good question. ActiveJob does some magic to bridge the gap between the style of Sidekiq, where perform is an instance method, and the style of Resque, where perform is a class method. I'm not sure exactly how it does that, and I've never tried using this gem with ActiveJob, but it seems like it may be possible to get it to work, and it may not be too hard. I'll leave this open so it can be looked into by me or some other enterprising individual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants