Sha256: e8459d855fa4ff821a6b58452b3ecda5e51f83f11501ba903960ed55a447f7e3
Contents?: true
Size: 767 Bytes
Versions: 1
Compression:
Stored size: 767 Bytes
Contents
# frozen_string_literal: true module AbstractNotifier module AsyncAdapters class ActiveJob class DeliveryJob < ::ActiveJob::Base def perform(notifier_class, *__rest__, &__block__) AbstractNotifier::NotificationDelivery.new(notifier_class.constantize, *__rest__, &__block__).notify_now end; respond_to?(:ruby2_keywords, true) && (ruby2_keywords :perform) end DEFAULT_QUEUE = "notifiers" attr_reader :job def initialize(queue: DEFAULT_QUEUE, job: DeliveryJob) @job = job.set(queue: queue) end def enqueue(...) job.perform_later(...) end; respond_to?(:ruby2_keywords, true) && (ruby2_keywords :enqueue) end end end AbstractNotifier.async_adapter ||= :active_job
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
active_delivery-1.0.0 | lib/.rbnext/3.0/abstract_notifier/async_adapters/active_job.rb |