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
34 35 36 37 |
# File 'lib/gapic/grpc_service_config/method_config.rb', line 34 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.
26 27 28 |
# File 'lib/gapic/grpc_service_config/method_config.rb', line 26 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)
44 45 46 |
# File 'lib/gapic/grpc_service_config/method_config.rb', line 44 def empty? @timeout_seconds.nil? && @retry_policy.empty? end |