Skip to content

Add async Python SDK client (AsyncAFS) over httpx - #21

Merged
rowantrollope merged 1 commit into
redis:mainfrom
zechengz:async-python-client
Jun 17, 2026
Merged

rowantrollope merged 1 commit into
redis:mainfrom
zechengz:async-python-client

Conversation

@zechengz

Copy link
Copy Markdown
Contributor

Summary

Adds a true-async client to the Python SDK (AsyncAFS and friends), mirroring the existing sync SDK and the TypeScript SDK's async shape. The sync SDK blocks on urllib.request.urlopen, which stalls the event loop inside async servers (FastAPI etc.); the async client awaits its I/O instead and fans out file sync concurrently.

  • True async over httpx.AsyncClient, shipped as the optional redis-afs[async] extra — the core install stays zero-dependency and imports fine without httpx (constructing an async client without it raises a clear error).
  • Mirrors the sync public API 1:1 (workspaces, checkpoints, mount, file ops, bash); from redis_afs import AsyncAFS.
  • Adds a MountMode enum (mirrors the control plane's workspace-* profiles); bounded-concurrency file sync; bash via create_subprocess_exec with kill+reap on timeout.
  • 39 tests (sync suite unchanged); README + api-docs document the async surface and the [async] extra.

Test plan

  • cd sdk/python && pip install -e '.[async]'
  • PYTHONPATH=src python3 -m unittest discover -s tests (39 passing)

🤖 Generated with Claude Code

True-async port of the sync SDK on httpx.AsyncClient, shipped as the
optional redis-afs[async] extra so the core stays zero-dependency.
Mirrors the sync public API; adds a MountMode enum and bounded-concurrency
file sync. 39 tests; README + api-docs updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jit-ci

jit-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@rowantrollope
rowantrollope marked this pull request as ready for review June 17, 2026 16:25
@rowantrollope
rowantrollope merged commit 8ffb200 into redis:main Jun 17, 2026
8 checks passed
@rowantrollope

Copy link
Copy Markdown
Collaborator

Thanks for the contribution Zecheng! Accepted the PR

@zechengz
zechengz deleted the async-python-client branch June 21, 2026 09:55
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