Class: GrpcKit::Calls::Server::RequestResponse

Inherits:
GrpcKit::Call show all
Defined in:
lib/grpc_kit/calls/server_request_response.rb

Instance Attribute Summary collapse

Attributes inherited from GrpcKit::Call

#metadata, #method, #method_name, #service_name

Instance Method Summary collapse

Methods inherited from GrpcKit::Call

#deadline

Constructor Details

#initializeRequestResponse

Returns a new instance of RequestResponse.



12
13
14
15
16
17
# File 'lib/grpc_kit/calls/server_request_response.rb', line 12

def initialize(**)
  super

  @outgoing_initial_metadata = {}
  @outgoing_trailing_metadata = {}
end

Instance Attribute Details

#outgoing_initial_metadataObject (readonly)

Returns the value of attribute outgoing_initial_metadata.



9
10
11
# File 'lib/grpc_kit/calls/server_request_response.rb', line 9

def 
  @outgoing_initial_metadata
end

#outgoing_trailing_metadataObject (readonly)

Returns the value of attribute outgoing_trailing_metadata.



9
10
11
# File 'lib/grpc_kit/calls/server_request_response.rb', line 9

def 
  @outgoing_trailing_metadata
end

Instance Method Details

#recvObject

Returns response object.

Returns:

  • (Object)

    response object



34
35
36
# File 'lib/grpc_kit/calls/server_request_response.rb', line 34

def recv
  @stream.recv_msg(@codec, last: true, limit_size: @config.max_receive_message_size)
end

#send_msg(data) ⇒ void

This method returns an undefined value.

Parameters:

  • data (Object)

    request message

  • last (Boolean)


22
23
24
25
26
27
28
29
30
31
# File 'lib/grpc_kit/calls/server_request_response.rb', line 22

def send_msg(data)
  @stream.send_msg(
    data,
    @codec,
    last: true,
    initial_metadata: @outgoing_initial_metadata,
    trailing_metadata: @outgoing_trailing_metadata,
    limit_size: @config.max_send_message_size,
  )
end