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.8.5.pre0 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.8.4 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.8.3 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.8.2 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.8.1 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.8.0 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.8.0.pre1 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.7.5 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.7.4 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.7.3 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.7.2 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.7.2.pre1 lib/protobuf/rpc/service_dispatcher.rb
protobuffy-4.0.1 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.7.1 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.7.0 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.7.0.pre3 lib/protobuf/rpc/service_dispatcher.rb
protobuffy-4.0.0 lib/protobuf/rpc/service_dispatcher.rb
protobuf-3.6.12 lib/protobuf/rpc/service_dispatcher.rb