Sha256: 254d93380645bff785952b5cbf3122af07972efd621b44de9cbf8a185aa4fb79
Contents?: true
Size: 974 Bytes
Versions: 12
Compression:
Stored size: 974 Bytes
Contents
# frozen_string_literal: true module Deimos module Backends # Abstract class for all publish backends. class Base class << self # @param producer_class [Class<Deimos::Producer>] # @param messages [Array<Deimos::Message>] # @return [void] def publish(producer_class:, messages:) Deimos.config.logger.info( message: 'Publishing messages', topic: messages.first&.topic, payloads: messages.map do |message| { payload: message.payload, key: message.key } end ) execute(producer_class: producer_class, messages: messages) end # @param producer_class [Class<Deimos::Producer>] # @param messages [Array<Deimos::Message>] # @return [void] def execute(producer_class:, messages:) raise NotImplementedError end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems