Module: GRPCWeb::GRPCRequestProcessor

Extended by:
ContentTypes
Defined in:
lib/grpc_web/server/grpc_request_processor.rb

Overview

Placeholder

Constant Summary

Constants included from ContentTypes

ContentTypes::ALL_CONTENT_TYPES, ContentTypes::BASE64_CONTENT_TYPES, ContentTypes::DEFAULT_CONTENT_TYPE, ContentTypes::JSON_CONTENT_TYPE, ContentTypes::PROTO_CONTENT_TYPE, ContentTypes::TEXT_CONTENT_TYPE, ContentTypes::TEXT_PROTO_CONTENT_TYPE, ContentTypes::UNSPECIFIED_CONTENT_TYPES

Class Method Summary collapse

Class Method Details

.process(grpc_web_request) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/grpc_web/server/grpc_request_processor.rb', line 15

def process(grpc_web_request)
  text_coder = ::GRPCWeb::TextCoder
  framing = ::GRPCWeb::RequestFraming
  serialization = ::GRPCWeb::MessageSerialization

  grpc_web_request = text_coder.decode_request(grpc_web_request)
  grpc_web_request = framing.unframe_request(grpc_web_request)
  grpc_web_request = serialization.deserialize_request(grpc_web_request)
  grpc_web_response = execute_request(grpc_web_request)
  grpc_web_response = serialization.serialize_response(grpc_web_response)
  grpc_web_response = framing.frame_response(grpc_web_response)
  text_coder.encode_response(grpc_web_response)
end