Skip to content

docs: async pagination examples use incompatible thenRun lambda #849

Description

@abhinavkr26104

Description

The asynchronous pagination examples in README.md pass a page-consuming lambda to CompletableFuture.thenRun, but thenRun accepts a zero-argument Runnable and does not provide the completed page.

Reproduction

Copy any of the async pagination examples around README.md lines 1346, 1351, or 1369 into a Java source file:

pageFuture.thenRun(page -> page.autoPager().subscribe(job -> {
    System.out.println(job);
}));

Compile the example with the SDK dependencies.

Expected behavior

The documentation should use a CompletableFuture method whose callback receives the completed page.

Actual behavior

The examples fail to compile because the lambda has one parameter while thenRun expects a no-argument Runnable.

Why this matters

Users following the documented async pagination examples encounter a compile error before making any API request.

Suggested fix

Replace thenRun with thenAccept in all three async pagination examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions