Skip to content

docs: close client in README example - #10

Merged
Project516 merged 1 commit into
mainfrom
docs/close-client-example
Aug 26, 2026
Merged

docs: close client in README example#10
Project516 merged 1 commit into
mainfrom
docs/close-client-example

Conversation

@Project516

@Project516 Project516 commented Aug 25, 2026

Copy link
Copy Markdown
Owner

On behalf of @Project516

The README example performs asynchronous requests and then closes the client only after both requests complete. If either request throws, client.close() is skipped and the underlying HTTP client remains open.

This updates the example to use try/finally, matching the README guidance to release the client when finished.

Tests: dart test (25 passed).

Summary by CodeRabbit

  • Documentation
    • Updated the usage example to ensure the client closes properly, even when an asynchronous request encounters an error.

@Project516

Copy link
Copy Markdown
Owner Author

cc @Project516

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 35c6552e-f368-4c84-8a58-a826dbe93614

📥 Commits

Reviewing files that changed from the base of the PR and between 16b1165 and 24a713b.

📒 Files selected for processing (1)
  • README.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The README usage example now wraps asynchronous API calls in try/finally. The client closes when requests succeed or fail.

Changes

Client cleanup example

Layer / File(s) Summary
Guaranteed client cleanup
README.md
The example moves client.close() into a finally block so cleanup runs after failed API calls.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 24a71

This localized documentation change improves cleanup in the README example, and no actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit checked the client with care

API calls hopped through the air
If one call failed
Cleanup prevailed
The client closed, safe in its lair

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: updating the README example to close the client.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Project516
Project516 merged commit 5ef7af2 into main Aug 26, 2026
2 checks passed
@Project516
Project516 deleted the docs/close-client-example branch August 26, 2026 13:16
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.

2 participants