De-idiom-ize a "wait for everything to finish" idiom

This commit is contained in:
Jon Chambers 2024-04-01 17:04:09 -04:00 committed by Jon Chambers
parent c4cbf0d618
commit f59c34004d
1 changed files with 1 additions and 2 deletions

View File

@ -309,8 +309,7 @@ public abstract class SingleUsePreKeyStore<K extends PreKey<?>> {
)) ))
.build()) .build())
.flatMap(deleteItemRequest -> Mono.fromFuture(() -> dynamoDbAsyncClient.deleteItem(deleteItemRequest)), DYNAMO_DB_MAX_BATCH_SIZE) .flatMap(deleteItemRequest -> Mono.fromFuture(() -> dynamoDbAsyncClient.deleteItem(deleteItemRequest)), DYNAMO_DB_MAX_BATCH_SIZE)
// Idiom: wait for everything to finish, but discard the results .then()
.reduce(0, (a, b) -> 0)
.toFuture() .toFuture()
.thenRun(Util.NOOP); .thenRun(Util.NOOP);
} }