public CompletableFuture<List<Task>> describe() {
    return new PaginatedResponseIterator<>(ListTasksResponse::nextToken, this::list)
        .stream()
        .map(ListTasksResponse::taskArns)
        .filter(arns -> !arns.isEmpty())
        .map(this::describeTasks)
        .collect(CompletableFutures.joinList())
        .thenApply(this::extractTasksFromResponses);
  }
Wrapper around paginated ECS list/describe Task APIs that efficiently describes all tasks.
scheduling-manager/src/main/java/com/amazonaws/blox/scheduling/state/TaskLister.java