Class: LaunchDarkly::Impl::Integrations::DynamoDB::DynamoDBUtil
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::Integrations::DynamoDB::DynamoDBUtil
- Defined in:
- lib/ldclient-rb/impl/integrations/dynamodb_impl.rb
Overview
Class Method Summary collapse
-
.batch_write_requests(client, table, requests) ⇒ Object
Calls client.batch_write_item as many times as necessary to submit all of the given requests.
Class Method Details
.batch_write_requests(client, table, requests) ⇒ Object
Calls client.batch_write_item as many times as necessary to submit all of the given requests. The requests array is consumed.
216 217 218 219 220 221 222 223 |
# File 'lib/ldclient-rb/impl/integrations/dynamodb_impl.rb', line 216 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 |