Class: Gapic::GrpcServiceConfig::MethodConfig

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(timeout_seconds, retry_policy) ⇒ MethodConfig

Create new MethodConfig

Parameters:



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_policyObject (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_secondsObject (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)

Returns:

  • (Boolean)

    whether MethodConfig is empty



45
46
47
# File 'lib/gapic/grpc_service_config/method_config.rb', line 45

def empty?
  @timeout_seconds.nil? && @retry_policy.empty?
end