Class: Deimos::Backends::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/deimos/backends/base.rb

Overview

Abstract class for all publish backends.

Direct Known Subclasses

Kafka, KafkaAsync, Outbox, Test

Class Method Summary collapse

Class Method Details

.execute(producer_class:, messages:) ⇒ void

This method returns an undefined value.

Parameters:

Raises:



20
21
22
# File 'lib/deimos/backends/base.rb', line 20

def execute(producer_class:, messages:)
  raise MissingImplementationError
end

.publish(producer_class:, messages:) ⇒ void

This method returns an undefined value.

Parameters:



11
12
13
14
15
# File 'lib/deimos/backends/base.rb', line 11

def publish(producer_class:, messages:)
  message = ::Deimos::Logging.messages_log_text(producer_class.karafka_config.payload_log, messages)
  Deimos::Logging.log_info({message: 'Publishing Messages:'}.merge(message))
  execute(producer_class: producer_class, messages: messages)
end