brandonhilkert / sucker_punch

Sucker Punch is a Ruby asynchronous processing library using concurrent-ruby, heavily influenced by Sidekiq and girl_friday.
MIT License
2.64k stars 114 forks source link

Cannot Subclass Class with included Job #28

Closed dstrelau closed 11 years ago

dstrelau commented 11 years ago

Something with the way the default worker count is being set makes the following explode:

require 'sucker_punch'

class A
  include SuckerPunch::Job
end
class B < A ; end

p A.new
p B.new
#<Celluloid::ActorProxy(A:0x203e)>
NoMethodError: undefined method `>' for nil:NilClass
               register at […]/sucker_punch-1.0.0/lib/sucker_punch/queue.rb:24
brandonhilkert commented 11 years ago

Is this something you do in a production environment? Or were you just hacking around?

dstrelau commented 11 years ago

Yes. Sorry for not explaining. I was trying to end up with something like this:

class BaseJob
  include SuckerPunch::Job
  def perform(*args)
     # stuff
  end
end

class ThisJob < BaseJob
  def perform(*args)
     super
     # other stuff
  end
end
brandonhilkert commented 11 years ago

Thanks for reporting it. Should be all set with v 1.0.1.

dstrelau commented 11 years ago

Awesome. Thanks!