Sha256: 48e267446c08c1f59096c5ba85e44deb017f885cc09ef9e1d0d35ca8afff1ffa

Contents?: true

Size: 713 Bytes

Versions: 38

Compression:

Stored size: 713 Bytes

Contents

require 'protobuf/logging'

module Protobuf
  module Rpc
    class ServiceDispatcher
      include ::Protobuf::Logging

      attr_reader :env

      def initialize(_app)
        # End of the line...
      end

      def call(env)
        dup._call(env)
      end

      def _call(env)
        @env = env

        env.response = dispatch_rpc_request
        env
      end

      def rpc_service
        @rpc_service ||= env.rpc_service.new(env)
      end

      private

      def dispatch_rpc_request
        rpc_service.call(method_name)
        rpc_service.response
      end

      def method_name
        env.method_name
      end

      def service_name
        env.service_name
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 3 rubygems

Version Path
protobuf-3.10.9 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.10.8 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.10.7 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.10.6 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.10.5 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.10.4 lib/protobuf/rpc/service_dispatcher.rb
protobuf-cucumber-3.10.8 lib/protobuf/rpc/service_dispatcher.rb
protobuf-cucumber-3.10.7 lib/protobuf/rpc/service_dispatcher.rb
protobuf-cucumber-3.10.6 lib/protobuf/rpc/service_dispatcher.rb
protobuf-cucumber-3.10.5 lib/protobuf/rpc/service_dispatcher.rb
protobuf-cucumber-3.10.4 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.10.3 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.10.2 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.10.1 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.10.0 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.10.0.pre0 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.9.0 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.9.0.pre2 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.9.0.pre lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.8.5 lib/protobuf/rpc/service_dispatcher.rb