Class: Protocol::GRPC::Interface::RPC
- Inherits:
-
Struct
- Object
- Struct
- Protocol::GRPC::Interface::RPC
- Defined in:
- lib/protocol/grpc/interface.rb
Overview
RPC method definition
Instance Attribute Summary collapse
-
#method ⇒ Object
Returns the value of attribute method.
-
#name ⇒ Object
Returns the value of attribute name.
-
#request_class ⇒ Object
Returns the value of attribute request_class.
-
#response_class ⇒ Object
Returns the value of attribute response_class.
-
#streaming ⇒ Object
Returns the value of attribute streaming.
Instance Method Summary collapse
-
#initialize(name:, request_class:, response_class:, streaming: :unary, method: nil) ⇒ RPC
constructor
Initialize a new RPC method definition.
-
#streaming? ⇒ Boolean
Check if this RPC is a streaming RPC (server, client, or bidirectional).
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
#method ⇒ Object
Returns the value of attribute method
27 28 29 |
# File 'lib/protocol/grpc/interface.rb', line 27 def method @method end |
#name ⇒ Object
Returns the value of attribute name
27 28 29 |
# File 'lib/protocol/grpc/interface.rb', line 27 def name @name end |
#request_class ⇒ Object
Returns the value of attribute request_class
27 28 29 |
# File 'lib/protocol/grpc/interface.rb', line 27 def request_class @request_class end |
#response_class ⇒ Object
Returns the value of attribute response_class
27 28 29 |
# File 'lib/protocol/grpc/interface.rb', line 27 def response_class @response_class end |
#streaming ⇒ Object
Returns the value of attribute 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.
41 42 43 |
# File 'lib/protocol/grpc/interface.rb', line 41 def streaming? streaming != :unary end |