Module: GRPCWeb::RequestFraming

Defined in:
lib/grpc_web/server/request_framing.rb

Overview

Framing concerns for handling a request on the server

Class Method Summary collapse

Class Method Details

.frame_response(response) ⇒ Object



17
18
19
20
# File 'lib/grpc_web/server/request_framing.rb', line 17

def frame_response(response)
  frames = message_framing.pack_frames(response.body)
  ::GRPCWeb::GRPCWebResponse.new(response.content_type, frames)
end

.unframe_request(request) ⇒ Object



10
11
12
13
14
15
# File 'lib/grpc_web/server/request_framing.rb', line 10

def unframe_request(request)
  frames = message_framing.unpack_frames(request.body)
  ::GRPCWeb::GRPCWebRequest.new(
    request.service, request.service_method, request.content_type, request.accept, frames,
  )
end