Skip to content

docs: Call close() to send Python SDK events on shutdown - #8972

Draft
flagsmithsmith[bot] wants to merge 1 commit into
mainfrom
docs/python-sdk-close-on-shutdown
Draft

flagsmithsmith[bot] wants to merge 1 commit into
mainfrom
docs/python-sdk-close-on-shutdown

Conversation

@flagsmithsmith

Copy link
Copy Markdown
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to Flagsmith/flagsmith-python-client#283

The Python SDK's event processor no longer sends buffered events when the interpreter exits. Instead, the application calls Flagsmith.close() when it shuts down. Flagsmith/flagsmith-python-client#283 adds close(). As asked in this review comment, this moves that PR's README section here:

  • Run an Experiment, Python tab: the example now ends with flagsmith.close() under # Before your application exits, like the Java, Node.js and Go tabs. A short note follows on registering it with atexit or a framework shutdown hook, and on the 5-second default timeout_seconds. This replaces the note saying buffered events are dropped at exit, with its max_buffer_items=1 workaround.
  • Set up with a coding agent: the prompt now lists Python close() instead of the same workaround.

This is a draft because released 6.5.1 doesn't have Flagsmith.close() yet. Merge it once the Python SDK release that includes Flagsmith/flagsmith-python-client#283 is out.

How did you test this code?

  • npx prettier@3.4.2 --check on both files, the same version and check that pre-commit runs: passes.
  • Checked close() and its timeout_seconds default of 5 seconds against the SDK PR's code and tests.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 16, 2026 2:10pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
flagsmith-frontend-preview Ignored Ignored Preview Nov 16, 2026 2:10pm UTC
flagsmith-frontend-staging Ignored Ignored Nov 16, 2026 2:10pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5eec4865-0b9e-474a-a5ad-4c4c60db249b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

flagsmithsmith Bot added a commit to Flagsmith/flagsmith-python-client that referenced this pull request Nov 16, 2026
The section on calling close() at shutdown now lives in the Python tab of
Run an Experiment (Flagsmith/flagsmith#8972).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the docs Documentation updates label Nov 16, 2026

This branch was successfully deployed

1 active deployment
Preview – docs — 78c8e969 Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants