Class: Google::Gax::BundleOptions

Inherits:
Struct
  • Object
show all
Defined in:
lib/google/gax/settings.rb

Overview

Holds values used to configure bundling.

The xxx_threshold attributes are used to configure when the bundled request should be made.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element_count_threshold: 0, element_count_limit: 0, request_byte_threshold: 0, request_byte_limit: 0, delay_threshold_millis: 0) ⇒ BundleOptions

Returns a new instance of BundleOptions.



304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/google/gax/settings.rb', line 304

def initialize(element_count_threshold: 0,
               element_count_limit: 0,
               request_byte_threshold: 0,
               request_byte_limit: 0,
               delay_threshold_millis: 0)
  super(
    element_count_threshold,
    element_count_limit,
    request_byte_threshold,
    request_byte_limit,
    delay_threshold_millis)
end

Instance Attribute Details

#delay_threshold_millisNumeric

Returns the bundled request will be sent this amount of time after the first element in the bundle was added to it.

Returns:

  • (Numeric)

    the bundled request will be sent this amount of time after the first element in the bundle was added to it.



270
271
272
# File 'lib/google/gax/settings.rb', line 270

def delay_threshold_millis
  @delay_threshold_millis
end

#element_count_limitNumeric

Returns represents a hard limit on the number of elements in the repeated field of the bundle; if adding a request to a bundle would exceed this value, the bundle is sent and the new request is added to a fresh bundle. It is invalid for a single request to exceed this limit.

Returns:

  • (Numeric)

    represents a hard limit on the number of elements in the repeated field of the bundle; if adding a request to a bundle would exceed this value, the bundle is sent and the new request is added to a fresh bundle. It is invalid for a single request to exceed this limit.



270
271
272
# File 'lib/google/gax/settings.rb', line 270

def element_count_limit
  @element_count_limit
end

#element_count_thresholdNumeric

Returns the bundled request will be sent once the count of outstanding elements in the repeated field reaches this value.

Returns:

  • (Numeric)

    the bundled request will be sent once the count of outstanding elements in the repeated field reaches this value.



270
271
272
# File 'lib/google/gax/settings.rb', line 270

def element_count_threshold
  @element_count_threshold
end

#request_byte_limitNumeric

Returns represents a hard limit on the size of the bundled request; if adding a request to a bundle would exceed this value, the bundle is sent and the new request is added to a fresh bundle. It is invalid for a single request to exceed this limit. Note that this value is pessimistically approximated by summing the bytesizes of the elements in the repeated field, with a buffer applied to correspond to the resulting under-approximation.

Returns:

  • (Numeric)

    represents a hard limit on the size of the bundled request; if adding a request to a bundle would exceed this value, the bundle is sent and the new request is added to a fresh bundle. It is invalid for a single request to exceed this limit. Note that this value is pessimistically approximated by summing the bytesizes of the elements in the repeated field, with a buffer applied to correspond to the resulting under-approximation.



270
271
272
# File 'lib/google/gax/settings.rb', line 270

def request_byte_limit
  @request_byte_limit
end

#request_byte_thresholdNumeric

Returns the bundled request will be sent once the count of bytes in the request reaches this value. Note that this value is pessimistically approximated by summing the bytesizes of the elements in the repeated field, and therefore may be an under-approximation.

Returns:

  • (Numeric)

    the bundled request will be sent once the count of bytes in the request reaches this value. Note that this value is pessimistically approximated by summing the bytesizes of the elements in the repeated field, and therefore may be an under-approximation.



270
271
272
# File 'lib/google/gax/settings.rb', line 270

def request_byte_threshold
  @request_byte_threshold
end