Skip to content

Add python-asyncio-fastapi example - #57

Merged
madhuchavva merged 1 commit into
mainfrom
python-asyncio-fastapi-example
Aug 11, 2026
Merged

Add python-asyncio-fastapi example#57
madhuchavva merged 1 commit into
mainfrom
python-asyncio-fastapi-example

Conversation

@madhuchavva

Copy link
Copy Markdown
Contributor

Summary

FastAPI example for the Python SDK's async integration pattern (growthbook >= 2.4.0, growthbook/growthbook-python#128): one lifespan-managed GrowthBookClient, an async Redis-backed sticky bucket service with a batched MGET get_all_assignments, and per-request UserContext. Falls back to an in-process store so it runs without Redis; docker-compose.yml provides Redis for the real path.

There was no Python example in this repo previously.

Test plan

  • Smoke-tested with FastAPI TestClient against the SDK branch: lifespan init, /checkout returns the experiment variant, sticky assignment persisted, /healthz responsive, clean shutdown drain
  • Manual run against a live GrowthBook instance once growthbook 2.4.0 is released (requirements.txt pins growthbook>=2.4.0)

@madhuchavva
madhuchavva merged commit eaf9508 into main Aug 11, 2026
1 check passed
@madhuchavva
madhuchavva deleted the python-asyncio-fastapi-example branch August 11, 2026 23: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.

1 participant