Sha256: 203a086e2e7b6e13ceb651ba98f39dd155a3f7f12f900c97ff5809faca9c4e9a
Contents?: true
Size: 1.5 KB
Versions: 11
Compression:
Stored size: 1.5 KB
Contents
# frozen_string_literal: true require 'opentracing/instrumentation/thrift/traced_protocol' module OpenTracing module Instrumentation module Thrift # Factory of TracedProtocol. Can be used thrift processor # # Usage (config.ru): # multiplexed_processor = Thrift::MultiplexedProcessor.new # binary_protocol_factory = # OpenTracing::Instrumentation::Thrift::TracedProtocolFactory.new( # Thrift::BinaryProtocolAcceleratedFactory.new, # ) # json_protocol_factory = # OpenTracing::Instrumentation::Thrift::TracedProtocolFactory.new( # Thrift::JsonProtocolFactory.new, # ) # protocol_factoreis_map = { # binary_protocol_factory => ['application/x-thrift'], # json_protocol_factory => ['application/json'], # } # thrift_app = # ::MultiprotocolThriftRackApp.new( # multiplexed_processor, # protocol_factoreis_map, # ) # run thrift_app class TracedProtocolFactory < ::Thrift::BaseProtocolFactory def initialize(protocol_factory, config: TracedProtocolConfig.new) @protocol_factory = protocol_factory @config = config end def get_protocol(trans) protocol = protocol_factory.get_protocol(trans) TracedProtocol.new(protocol, config: config) end private attr_reader :protocol_factory, :config end end end end
Version data entries
11 entries across 11 versions & 1 rubygems