lib/reactor/subscription.rb in reactor-0.17.0 vs lib/reactor/subscription.rb in reactor-0.18.0
- old
+ new
@@ -1,10 +1,10 @@
module Reactor
class Subscription
attr_reader :source, :event_name, :action, :handler_name, :delay, :async, :worker_class,
- :deprecated
+ :deprecated, :sidekiq_options
def self.build_handler_name(event_name, handler_name_option = nil)
if handler_name_option
handler_name_option.to_s.camelize
elsif event_name == '*'
@@ -24,10 +24,11 @@
@action = options[:action] || block
@delay = options[:delay].to_i
@async = determine_async(options)
@deprecated = !!options[:deprecated]
+ @sidekiq_options = options[:sidekiq_options] || {}
build_worker_class
end
def handler_defined?
namespace.const_defined?(handler_name) &&
@@ -83,10 +84,11 @@
self.source = subscription.source
self.action = subscription.action
self.async = subscription.async
self.delay = subscription.delay
self.deprecated = subscription.deprecated
+ self.sidekiq_options subscription.sidekiq_options
end
end
def build_mailer_worker
subscription = self
@@ -94,9 +96,10 @@
self.source = subscription.source
self.action = subscription.action
self.delay = subscription.delay
self.async = subscription.async
self.deprecated = subscription.deprecated
+ self.sidekiq_options subscription.sidekiq_options
end
end
end
end