Class: Karafka::ActiveJob::Dispatcher
- Inherits:
-
Object
- Object
- Karafka::ActiveJob::Dispatcher
show all
- Defined in:
- lib/karafka/active_job/dispatcher.rb
Overview
Dispatcher that sends the ActiveJob job to a proper topic based on the queue name
Instance Method Summary
collapse
Instance Method Details
#call(job) ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/karafka/active_job/dispatcher.rb', line 16
def call(job)
::Karafka.producer.public_send(
fetch_option(job, :dispatch_method, DEFAULTS),
topic: job.queue_name,
payload: ::ActiveSupport::JSON.encode(job.serialize)
)
end
|