Sha256: 82c1656921144fd40719ca280a9d8470f02bc8d1b693b37007dbab723843f5b6

Contents?: true

Size: 1.05 KB

Versions: 6

Compression:

Stored size: 1.05 KB

Contents

require 'sqreen/ecosystem/tracing/modules/determine_ip'
require 'sqreen/ecosystem/tracing/signals/tracing_consumer'
require 'sqreen/ecosystem/module_api'
require 'sqreen/ecosystem/module_api/tracing/consumer_data'

module Sqreen
  module Ecosystem
    module Tracing
      module Modules
        class Consumer
          include ModuleApi::Tracing
          include ModuleApi::TracingIdGeneration
          include ModuleApi::Loggable

          consumes    ModuleApi::Tracing::ConsumerData
          fixed_scope 'consumer'

          # @param [ModuleApi::Tracing::ConsumerData] data
          def receive(data)
            signal = Tracing::Signals::TracingConsumer.new
            signal.payload = Tracing::Signals::TracingConsumer::Payload.new(
              message_type: data.message_type,
              host: data.host || '',
              ip: data.ip,
              topic: data.topic,
              tracing_identifier: data.tracing_identifier || create_tracing_id
            )

            submit_signal signal
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sqreen-1.22.0-java lib/sqreen/ecosystem/tracing/modules/consumer.rb
sqreen-1.22.0 lib/sqreen/ecosystem/tracing/modules/consumer.rb
sqreen-1.21.1-java lib/sqreen/ecosystem/tracing/modules/consumer.rb
sqreen-1.21.1 lib/sqreen/ecosystem/tracing/modules/consumer.rb
sqreen-1.21.0-java lib/sqreen/ecosystem/tracing/modules/consumer.rb
sqreen-1.21.0 lib/sqreen/ecosystem/tracing/modules/consumer.rb