lib/maitredee/publisher.rb in maitredee-0.8.1 vs lib/maitredee/publisher.rb in maitredee-0.8.2
- old
+ new
@@ -1,19 +1,8 @@
-require "active_job"
-
module Maitredee
class Publisher
class << self
- def inherited(subclass)
- subclass.const_set("PublisherJob", Class.new(PublisherJob))
- subclass::PublisherJob.service_class = subclass
- end
-
- def call_later(*args)
- self::PublisherJob.perform_later(*args)
- end
-
def call(*args)
publisher = new(*args)
publisher.process
publisher.published_messages
end
@@ -42,18 +31,8 @@
event_name: event_name || defaults[:event_name],
schema_name: schema_name || defaults[:schema_name],
primary_key: primary_key,
body: body
)
- end
-
- class PublisherJob < ::ActiveJob::Base
- class << self
- attr_accessor :service_class
- end
-
- def perform(*args)
- self.class.service_class.call(*args)
- end
end
end
end