Skip to content

Commit

Permalink
fix issue #15509 (#17329)
Browse files Browse the repository at this point in the history
  • Loading branch information
Melanie-Ma authored Jan 8, 2021
1 parent 4e83f0f commit f698617
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,33 @@ public void iterableByPageWhileSnippet() {
CustomPagedFlux<String> createCustomInstance() {

// A supplier that fetches the first page of data from source/service
Supplier<Mono<PagedResponse<String>>> firstPageRetriever = () -> null;
Supplier<Mono<PagedResponse<String>>> firstPageRetriever = () -> getFirstPage();

// A function that fetches subsequent pages of data from source/service given a continuation token
Function<String, Mono<PagedResponse<String>>> nextPageRetriever =
continuationToken -> null;
continuationToken -> getNextPage(continuationToken);

CustomPagedFlux<String> pagedFlux = new CustomPagedFlux<>(firstPageRetriever,
nextPageRetriever);
return pagedFlux;
}

/**
* Implementation not provided
*
* @param continuationToken Token to fetch the next page
* @return A {@link Mono} of {@link PagedResponse} containing items of type {@code Integer}
*/
private Mono<PagedResponse<String>> getNextPage(String continuationToken) {
return null;
}

/**
* Implementation not provided
*
* @return A {@link Mono} of {@link PagedResponse} containing items of type {@code Integer}
*/
private Mono<PagedResponse<String>> getFirstPage() {
return null;
}
}

0 comments on commit f698617

Please sign in to comment.