Class: PubsubNotifier::Broadcasters::ActiveJobBroadcaster

Inherits:
Base
  • Object
show all
Defined in:
lib/pubsub_notifier/broadcasters/active_job_broadcaster.rb

Defined Under Namespace

Classes: BroadcastJob

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#configure, #initialize

Constructor Details

This class inherits a constructor from PubsubNotifier::Broadcasters::Base

Instance Method Details

#broadcast(subscriber, publisher, event, args) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/pubsub_notifier/broadcasters/active_job_broadcaster.rb', line 4

def broadcast(subscriber, publisher, event, args)
  configured_job.perform_later(subscriber.name, event, args)
rescue ActiveJob::SerializationError => e
  # NOTE: Fallback if global_id is blank
  logger.warn { e.inspect }
  configured_job.perform_now(subscriber.name, event, *args)
end