Sha256: 16d6200d55f67bc9ecb3762f5521d4ad180489d39c2e7f47c07723e9086e9737

Contents?: true

Size: 846 Bytes

Versions: 27

Compression:

Stored size: 846 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Consumers
    # Feature that allows us to use responders flow in consumer
    module Responders
      # Responds with given data using given responder. This allows us to have a similar way of
      # defining flows like synchronous protocols
      # @param data Anything we want to pass to responder based on which we want to trigger further
      #   Kafka responding
      def respond_with(*data)
        Karafka.monitor.instrument(
          'consumers.responders.respond_with',
          caller: self,
          data: data
        ) do
          # @note we build a new instance of responder each time, as a long-running (persisted)
          #   consumers can respond multiple times during the life-cycle
          topic.responder.new.call(*data)
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
karafka-1.4.15 lib/karafka/consumers/responders.rb
karafka-1.4.14 lib/karafka/consumers/responders.rb
karafka-1.4.13 lib/karafka/consumers/responders.rb
karafka-1.4.12 lib/karafka/consumers/responders.rb
karafka-1.4.11 lib/karafka/consumers/responders.rb
karafka-1.4.10 lib/karafka/consumers/responders.rb
karafka-1.4.9 lib/karafka/consumers/responders.rb
karafka-1.4.8 lib/karafka/consumers/responders.rb
karafka-1.4.7 lib/karafka/consumers/responders.rb
karafka-1.4.6 lib/karafka/consumers/responders.rb
karafka-1.4.5 lib/karafka/consumers/responders.rb
karafka-1.4.4 lib/karafka/consumers/responders.rb
karafka-1.4.3 lib/karafka/consumers/responders.rb
karafka-1.4.2 lib/karafka/consumers/responders.rb
karafka-1.4.1 lib/karafka/consumers/responders.rb
karafka-1.4.0 lib/karafka/consumers/responders.rb
karafka-1.4.0.rc2 lib/karafka/consumers/responders.rb
karafka-1.4.0.rc1 lib/karafka/consumers/responders.rb
karafka-1.3.7 lib/karafka/consumers/responders.rb
karafka-1.3.6 lib/karafka/consumers/responders.rb