Skip to content

chore: Add async support classes for concurrency and HTTP transport#451

Draft
jsonbailey wants to merge 2 commits into
mainfrom
jb/sdk-2601/async-shim-layer
Draft

chore: Add async support classes for concurrency and HTTP transport#451
jsonbailey wants to merge 2 commits into
mainfrom
jb/sdk-2601/async-shim-layer

Conversation

@jsonbailey

@jsonbailey jsonbailey commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What

Adds the async support classes the async SDK is built on, under ldclient/impl/aio/. Pure-additive: the package is dormant until its first consumer lands in a later slice, so it adds no runtime surface to main beyond the new (as-yet-unimported) modules.

  • aio/concurrency.py — async concurrency primitives: AsyncEvent, AsyncLock, AsyncQueue, AsyncRepeatingTask, AsyncWorkerPool, AsyncTaskRunner, AsyncCallbackScheduler, and spawn_handle/join_handle. Each wraps a piece of fiddly asyncio plumbing (timeout-aware waits, queue exception normalization, an interval-from-start repeating task, a bounded task pool) that async callers would otherwise inline repeatedly.
  • aio/transport.py — async HTTP/SSE transport (AsyncHTTPTransport, AsyncSSEFactory, make_client_session) over aiohttp.
  • aio/transport_types.py — the shared TransportResponse.
  • testing/test_aio.py — unit tests for the above (they previously shipped untested).
  • pyproject.toml — the async packaging these need: the [async] aiohttp extra plus aiohttp / pytest-asyncio dev deps and asyncio_mode="strict" (the tests run under pytest-asyncio, so CI can't pass without it).

Why

Foundation for the async Python SDK (epic SDK-60). These are genuine async support classes, not a compatibility shim: there is no sync twin — the sync code uses the equivalent stdlib/SDK primitives (threading, queue.Queue, RepeatingTask, FixedThreadPool, urllib3) directly.

Consumed by later slices: concurrency.py first by async big segments and the async flag tracker, then the event processor, data sources, and data systems; transport.py first by async FDv1 streaming/polling, then the event processor and FDv2 sources.

Validation

  • uv run pytest ldclient/testing/test_aio.py — 28 passed
  • uv run mypy ldclient — clean
  • isort / pycodestyle — clean

Refs SDK-2601 (epic SDK-60).

@jsonbailey jsonbailey changed the title feat: Add async shim layer for concurrency and HTTP transport chore: Add async shim layer for concurrency and HTTP transport Jun 25, 2026
…ridges

Aligns the slice with the impl branch: impl/shims/ -> impl/aio/ (concurrency.py, transport.py, transport_types.py), test -> testing/test_aio.py. The package is a genuine async support library, not a compatibility shim.
@jsonbailey jsonbailey changed the title chore: Add async shim layer for concurrency and HTTP transport chore: Add async support classes for concurrency and HTTP transport Jul 10, 2026
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