Class: Gapic::GrpcServiceConfig::MethodConfig
- Inherits:
-
Object
- Object
- Gapic::GrpcServiceConfig::MethodConfig
- Defined in:
- lib/gapic/grpc_service_config/method_config.rb
Overview
Method config represents a combination of a timeout and a retry policy, both of which can be optional It is applied during a GRPC method call and governs the client-side timeout/retry policy
Instance Attribute Summary collapse
-
#retry_policy ⇒ Object
readonly
Returns the value of attribute retry_policy.
-
#timeout_seconds ⇒ Object
readonly
Returns the value of attribute timeout_seconds.
Instance Method Summary collapse
-
#empty? ⇒ Boolean
Returns whether MethodConfig is empty (does not contain any values).
-
#initialize(timeout_seconds, retry_policy) ⇒ MethodConfig
constructor
Create new MethodConfig.
Constructor Details
#initialize(timeout_seconds, retry_policy) ⇒ MethodConfig
Create new MethodConfig
35 36 37 38 |
# File 'lib/gapic/grpc_service_config/method_config.rb', line 35 def initialize timeout_seconds, retry_policy @timeout_seconds = timeout_seconds @retry_policy = retry_policy end |
Instance Attribute Details
#retry_policy ⇒ Object (readonly)
Returns the value of attribute retry_policy.
27 28 29 |
# File 'lib/gapic/grpc_service_config/method_config.rb', line 27 def retry_policy @retry_policy end |
#timeout_seconds ⇒ Object (readonly)
Returns the value of attribute timeout_seconds.
26 27 28 |
# File 'lib/gapic/grpc_service_config/method_config.rb', line 26 def timeout_seconds @timeout_seconds end |
Instance Method Details
#empty? ⇒ Boolean
Returns whether MethodConfig is empty (does not contain any values)
45 46 47 |
# File 'lib/gapic/grpc_service_config/method_config.rb', line 45 def empty? @timeout_seconds.nil? && @retry_policy.empty? end |