Repository navigation
docs: clarify reusable flush and terminal shutdown guidance - #1043
Draft
marandaneto wants to merge 1 commit into
Draft
marandaneto wants to merge 1 commit into
marandaneto wants to merge 1 commit into
Conversation
Contributor
posthog-python Compliance ReportDate: 2026-10-09T17:23:56.478116+00:00 ✅ All Tests Passed!121/121 tests passed Capture_V1 Tests✅ 95/95 tests passed View Details
Capture_Ai Tests✅ 5/5 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
Feature_Flags_Local_Evaluation Tests✅ 4/4 tests passed View Details
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
The lifecycle docstrings discourage direct
flush()use and tell serverless users to callshutdown(), even though shared clients must remain open for later invocations.Clarify both instance and module-level guidance. Shared clients should flush before a short-lived invocation returns. Disposable clients and final process cleanup should use terminal shutdown.
The docs now distinguish timeout units, event and span draining, callback deferral, open spans, and delivery limitations. Neither call guarantees server receipt, and flush is not a strict whole-call wall-clock deadline. The current-version and latest generated references match the source docstrings.
No runtime logic, signatures, or public API changed. A patch Sampo changeset is included.
💚 How did you test it?
autoreview --mode branch --base origin/mainpassed foraef811ed95c36f0f8bd7172881fca3dad5c832ecwith no actionable findings.📝 Checklist
No new tests were needed because runtime behavior is unchanged. Existing lifecycle tests validate the documented behavior.
If releasing new changes
sampo addto generate a changeset fileThe Sampo patch changeset was written directly in the repository's standard format.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Pi and implementation subagents used Git, local SDK specifications, pytest, Ruff, reference generation, and isolated Pi autoreview. The source implementation determined the lifecycle and timeout wording. The session is local and has not been published.