Class: LaunchDarkly::Impl::Integrations::DynamoDB::DynamoDBUtil Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/impl/integrations/dynamodb_impl.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 5.5.0

Class Method Summary collapse

Class Method Details

.batch_write_requests(client, table, requests) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Calls client.batch_write_item as many times as necessary to submit all of the given requests. The requests array is consumed.

Since:

  • 5.5.0



288
289
290
291
292
293
294
295
# File 'lib/ldclient-rb/impl/integrations/dynamodb_impl.rb', line 288

def self.batch_write_requests(client, table, requests)
  batch_size = 25
  while true
    chunk = requests.shift(batch_size)
    break if chunk.empty?
    client.batch_write_item({ request_items: { table => chunk } })
  end
end