Class: Google::Gax::CallSettings
- Inherits:
-
Object
- Object
- Google::Gax::CallSettings
- Defined in:
- lib/google/gax.rb
Overview
Encapsulates the call settings for an ApiCallable
Instance Attribute Summary collapse
- #bundle_descriptor ⇒ BundleDescriptor readonly
-
#bundler ⇒ Object
readonly
Returns the value of attribute bundler.
- #page_descriptor ⇒ PageDescriptor readonly
- #retry_options ⇒ RetryOptions readonly
- #timeout ⇒ Numeric readonly
Instance Method Summary collapse
-
#bundler? ⇒ Boolean
True when it has valid bundler configuration.
-
#initialize(timeout: 30, retry_options: nil, page_descriptor: nil, bundler: nil, bundle_descriptor: nil) ⇒ CallSettings
constructor
A new instance of CallSettings.
-
#merge(options) ⇒ Object
Creates a new CallSetting instance which is based on this but merged settings from options.
-
#retry_codes? ⇒ Boolean
True when it has retry codes.
Constructor Details
#initialize(timeout: 30, retry_options: nil, page_descriptor: nil, bundler: nil, bundle_descriptor: nil) ⇒ CallSettings
Returns a new instance of CallSettings.
63 64 65 66 67 68 69 70 71 |
# File 'lib/google/gax.rb', line 63 def initialize( timeout: 30, retry_options: nil, page_descriptor: nil, bundler: nil, bundle_descriptor: nil) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @bundler = bundler @bundle_descriptor = bundle_descriptor end |
Instance Attribute Details
#bundle_descriptor ⇒ BundleDescriptor (readonly)
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/google/gax.rb', line 48 class CallSettings attr_reader :timeout, :retry_options, :page_descriptor, :bundler, :bundle_descriptor # @param timeout [Numeric] The client-side timeout for API calls. This # parameter is ignored for retrying calls. # @param retry_options [RetryOptions] The configuration for retrying upon # transient error. If set to None, this call will not retry. # @param page_descriptor [PageDescriptor] indicates the structure of page # streaming to be performed. If set to None, page streaming is not # performed. # @param bundler orchestrates bundling. If None, bundling is not # performed. # @param bundle_descriptor [BundleDescriptor] indicates the structure of # the bundle. If None, bundling is not performed. def initialize( timeout: 30, retry_options: nil, page_descriptor: nil, bundler: nil, bundle_descriptor: nil) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @bundler = bundler @bundle_descriptor = bundle_descriptor end # @return true when it has retry codes. def retry_codes? @retry_options && @retry_options.retry_codes end # @return true when it has valid bundler configuration. def bundler? @bundler && @bundle_descriptor end # Creates a new CallSetting instance which is based on this but merged # settings from options. # @param options [CallOptions, nil] The overriding call settings. # @return a new merged call settings. def merge() unless return CallSettings.new( timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, bundler: @bundler, bundle_descriptor: @bundle_descriptor) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_descriptor = @page_descriptor if .is_page_streaming CallSettings.new( timeout: timeout, retry_options: , page_descriptor: page_descriptor, bundler: @bundler, bundle_descriptor: @bundle_descriptor) end end |
#bundler ⇒ Object (readonly)
Returns the value of attribute bundler.
49 50 51 |
# File 'lib/google/gax.rb', line 49 def bundler @bundler end |
#page_descriptor ⇒ PageDescriptor (readonly)
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/google/gax.rb', line 48 class CallSettings attr_reader :timeout, :retry_options, :page_descriptor, :bundler, :bundle_descriptor # @param timeout [Numeric] The client-side timeout for API calls. This # parameter is ignored for retrying calls. # @param retry_options [RetryOptions] The configuration for retrying upon # transient error. If set to None, this call will not retry. # @param page_descriptor [PageDescriptor] indicates the structure of page # streaming to be performed. If set to None, page streaming is not # performed. # @param bundler orchestrates bundling. If None, bundling is not # performed. # @param bundle_descriptor [BundleDescriptor] indicates the structure of # the bundle. If None, bundling is not performed. def initialize( timeout: 30, retry_options: nil, page_descriptor: nil, bundler: nil, bundle_descriptor: nil) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @bundler = bundler @bundle_descriptor = bundle_descriptor end # @return true when it has retry codes. def retry_codes? @retry_options && @retry_options.retry_codes end # @return true when it has valid bundler configuration. def bundler? @bundler && @bundle_descriptor end # Creates a new CallSetting instance which is based on this but merged # settings from options. # @param options [CallOptions, nil] The overriding call settings. # @return a new merged call settings. def merge() unless return CallSettings.new( timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, bundler: @bundler, bundle_descriptor: @bundle_descriptor) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_descriptor = @page_descriptor if .is_page_streaming CallSettings.new( timeout: timeout, retry_options: , page_descriptor: page_descriptor, bundler: @bundler, bundle_descriptor: @bundle_descriptor) end end |
#retry_options ⇒ RetryOptions (readonly)
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/google/gax.rb', line 48 class CallSettings attr_reader :timeout, :retry_options, :page_descriptor, :bundler, :bundle_descriptor # @param timeout [Numeric] The client-side timeout for API calls. This # parameter is ignored for retrying calls. # @param retry_options [RetryOptions] The configuration for retrying upon # transient error. If set to None, this call will not retry. # @param page_descriptor [PageDescriptor] indicates the structure of page # streaming to be performed. If set to None, page streaming is not # performed. # @param bundler orchestrates bundling. If None, bundling is not # performed. # @param bundle_descriptor [BundleDescriptor] indicates the structure of # the bundle. If None, bundling is not performed. def initialize( timeout: 30, retry_options: nil, page_descriptor: nil, bundler: nil, bundle_descriptor: nil) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @bundler = bundler @bundle_descriptor = bundle_descriptor end # @return true when it has retry codes. def retry_codes? @retry_options && @retry_options.retry_codes end # @return true when it has valid bundler configuration. def bundler? @bundler && @bundle_descriptor end # Creates a new CallSetting instance which is based on this but merged # settings from options. # @param options [CallOptions, nil] The overriding call settings. # @return a new merged call settings. def merge() unless return CallSettings.new( timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, bundler: @bundler, bundle_descriptor: @bundle_descriptor) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_descriptor = @page_descriptor if .is_page_streaming CallSettings.new( timeout: timeout, retry_options: , page_descriptor: page_descriptor, bundler: @bundler, bundle_descriptor: @bundle_descriptor) end end |
#timeout ⇒ Numeric (readonly)
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/google/gax.rb', line 48 class CallSettings attr_reader :timeout, :retry_options, :page_descriptor, :bundler, :bundle_descriptor # @param timeout [Numeric] The client-side timeout for API calls. This # parameter is ignored for retrying calls. # @param retry_options [RetryOptions] The configuration for retrying upon # transient error. If set to None, this call will not retry. # @param page_descriptor [PageDescriptor] indicates the structure of page # streaming to be performed. If set to None, page streaming is not # performed. # @param bundler orchestrates bundling. If None, bundling is not # performed. # @param bundle_descriptor [BundleDescriptor] indicates the structure of # the bundle. If None, bundling is not performed. def initialize( timeout: 30, retry_options: nil, page_descriptor: nil, bundler: nil, bundle_descriptor: nil) @timeout = timeout @retry_options = @page_descriptor = page_descriptor @bundler = bundler @bundle_descriptor = bundle_descriptor end # @return true when it has retry codes. def retry_codes? @retry_options && @retry_options.retry_codes end # @return true when it has valid bundler configuration. def bundler? @bundler && @bundle_descriptor end # Creates a new CallSetting instance which is based on this but merged # settings from options. # @param options [CallOptions, nil] The overriding call settings. # @return a new merged call settings. def merge() unless return CallSettings.new( timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, bundler: @bundler, bundle_descriptor: @bundle_descriptor) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_descriptor = @page_descriptor if .is_page_streaming CallSettings.new( timeout: timeout, retry_options: , page_descriptor: page_descriptor, bundler: @bundler, bundle_descriptor: @bundle_descriptor) end end |
Instance Method Details
#bundler? ⇒ Boolean
Returns true when it has valid bundler configuration.
79 80 81 |
# File 'lib/google/gax.rb', line 79 def bundler? @bundler && @bundle_descriptor end |
#merge(options) ⇒ Object
Creates a new CallSetting instance which is based on this but merged settings from options.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/google/gax.rb', line 87 def merge() unless return CallSettings.new( timeout: @timeout, retry_options: @retry_options, page_descriptor: @page_descriptor, bundler: @bundler, bundle_descriptor: @bundle_descriptor) end timeout = if .timeout == :OPTION_INHERIT @timeout else .timeout end = if . == :OPTION_INHERIT @retry_options else . end page_descriptor = @page_descriptor if .is_page_streaming CallSettings.new( timeout: timeout, retry_options: , page_descriptor: page_descriptor, bundler: @bundler, bundle_descriptor: @bundle_descriptor) end |
#retry_codes? ⇒ Boolean
Returns true when it has retry codes.
74 75 76 |
# File 'lib/google/gax.rb', line 74 def retry_codes? @retry_options && @retry_options.retry_codes end |