Class: AbstractNotifier::AsyncAdapters::ActiveJob
- Inherits:
-
Object
- Object
- AbstractNotifier::AsyncAdapters::ActiveJob
- Defined in:
- lib/abstract_notifier/async_adapters/active_job.rb
Defined Under Namespace
Classes: DeliveryJob
Constant Summary collapse
- DEFAULT_QUEUE =
"notifiers"
Instance Attribute Summary collapse
-
#job ⇒ Object
readonly
Returns the value of attribute job.
Instance Method Summary collapse
- #enqueue(notifier_class, payload) ⇒ Object
-
#initialize(queue: DEFAULT_QUEUE, job: DeliveryJob) ⇒ ActiveJob
constructor
A new instance of ActiveJob.
Constructor Details
#initialize(queue: DEFAULT_QUEUE, job: DeliveryJob) ⇒ ActiveJob
Returns a new instance of ActiveJob.
16 17 18 |
# File 'lib/abstract_notifier/async_adapters/active_job.rb', line 16 def initialize(queue: DEFAULT_QUEUE, job: DeliveryJob) @job = job.set(queue: queue) end |
Instance Attribute Details
#job ⇒ Object (readonly)
Returns the value of attribute job.
14 15 16 |
# File 'lib/abstract_notifier/async_adapters/active_job.rb', line 14 def job @job end |
Instance Method Details
#enqueue(notifier_class, payload) ⇒ Object
20 21 22 |
# File 'lib/abstract_notifier/async_adapters/active_job.rb', line 20 def enqueue(notifier_class, payload) job.perform_later(notifier_class.name, payload) end |