private void awaitPending()

in sdk-java/src/main/java/com/spotify/confidence/EventSenderEngineImpl.java [162:174]


  private void awaitPending() {
    try {
      final CompletableFuture<?>[] pending =
          pendingBatches.stream()
              .map(future -> future.exceptionally(throwable -> null))
              .toArray(CompletableFuture[]::new);
      CompletableFuture.allOf(pending).get(10, TimeUnit.SECONDS);
    } catch (InterruptedException e) {
      // reset the interrupt status
      Thread.currentThread().interrupt();
    } catch (ExecutionException | TimeoutException ignored) {
    }
  }