Skip to content

docs: use context manager in read session examples#90

Merged
quettabit merged 1 commit into
mainfrom
qb/read-sess-docs
Jul 21, 2026
Merged

docs: use context manager in read session examples#90
quettabit merged 1 commit into
mainfrom
qb/read-sess-docs

Conversation

@quettabit

Copy link
Copy Markdown
Member

No description provided.

@quettabit

Copy link
Copy Markdown
Member Author

@greptileai review pls

@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates read-session examples to use explicit async context management. The main changes are:

  • Wraps the consumer read session in async with.
  • Updates five documentation examples to iterate over the entered session.
  • Ensures read sessions close when each context exits.

Confidence Score: 5/5

This looks safe to merge.

  • The examples follow the supported async context-manager and iterator contracts.
  • Context exit closes the session and stops its background read task.
  • No blocking issues were found in the updated code.

Important Files Changed

Filename Overview
examples/consumer.py Uses the read session as an async context manager before iterating over batches.
examples/docs/streams.py Updates the documented read-session variants to use explicit context-managed cleanup.

Reviews (2): Last reviewed commit: "initial commit" | Re-trigger Greptile

@quettabit
quettabit force-pushed the qb/read-sess-docs branch from ec0831c to d72749d Compare July 21, 2026 23:29
@quettabit quettabit changed the title docs: update read session examples docs: use context manager in read session examples Jul 21, 2026
@quettabit
quettabit marked this pull request as ready for review July 21, 2026 23:36
@quettabit
quettabit requested a review from a team as a code owner July 21, 2026 23:36
@quettabit
quettabit merged commit 6cfbd98 into main Jul 21, 2026
11 checks passed
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.

1 participant