Skip to content

docs: fix async pagination examples - #848

Open
abhinavkr26104 wants to merge 1 commit into
openai:mainfrom
abhinavkr26104:codex/fix-async-pagination-readme
Open

docs: fix async pagination examples#848
abhinavkr26104 wants to merge 1 commit into
openai:mainfrom
abhinavkr26104:codex/fix-async-pagination-readme

Conversation

@abhinavkr26104

@abhinavkr26104 abhinavkr26104 commented Aug 10, 2026

Copy link
Copy Markdown

Summary

  • replace CompletableFuture.thenRun with thenAccept in the async pagination README examples
  • keep the page value available to call page.autoPager()

Problem

The examples passed a page -> ... lambda to thenRun. Java's CompletableFuture.thenRun accepts a zero-argument Runnable, so all three snippets failed to compile as documented.

Reproduction

  1. Copy the async pagination examples from README.md into a Java source file.
  2. Compile with the SDK dependencies.
  3. The compiler rejects each pageFuture.thenRun(page -> ...) call because the lambda has an unexpected parameter.

Fix

Use thenAccept, whose Consumer<JobListPageAsync> receives the completed page.

Validation

  • git diff --check
  • Local Gradle compile/test attempts exceeded the command timeout without producing a compiler or test failure.

Fixes #849

@abhinavkr26104
abhinavkr26104 requested a review from a team as a code owner August 10, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: async pagination examples use incompatible thenRun lambda

1 participant