Class: Protocol::GRPC::Interface::RPC

Inherits:
Struct
  • Object
show all
Defined in:
lib/protocol/grpc/interface.rb

Overview

RPC method definition

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, request_class:, response_class:, streaming: :unary, method: nil) ⇒ RPC

Initialize a new RPC method definition.



34
35
36
# File 'lib/protocol/grpc/interface.rb', line 34

def initialize(name:, request_class:, response_class:, streaming: :unary, method: nil)
	super
end

Instance Attribute Details

#methodObject

Returns the value of attribute method

Returns:

  • (Object)

    the current value of method



27
28
29
# File 'lib/protocol/grpc/interface.rb', line 27

def method
  @method
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



27
28
29
# File 'lib/protocol/grpc/interface.rb', line 27

def name
  @name
end

#request_classObject

Returns the value of attribute request_class

Returns:

  • (Object)

    the current value of request_class



27
28
29
# File 'lib/protocol/grpc/interface.rb', line 27

def request_class
  @request_class
end

#response_classObject

Returns the value of attribute response_class

Returns:

  • (Object)

    the current value of response_class



27
28
29
# File 'lib/protocol/grpc/interface.rb', line 27

def response_class
  @response_class
end

#streamingObject

Returns the value of attribute streaming

Returns:

  • (Object)

    the current value of streaming



27
28
29
# File 'lib/protocol/grpc/interface.rb', line 27

def streaming
  @streaming
end

Instance Method Details

#streaming?Boolean

Check if this RPC is a streaming RPC (server, client, or bidirectional). Server-side handlers for streaming RPCs are expected to block until all messages are sent.

Returns:

  • (Boolean)


41
42
43
# File 'lib/protocol/grpc/interface.rb', line 41

def streaming?
	streaming != :unary
end