Skip to content

feat: public async transport - #474

Open
alexanto wants to merge 3 commits into
feat/public-sync-transportfrom
feat/async-transport
Open

alexanto wants to merge 3 commits into
feat/public-sync-transportfrom
feat/async-transport

Conversation

@alexanto

@alexanto alexanto commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

async ounterpart of #473

@ppicom

ppicom commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Hi there! I haven't looked at the code, just at the number of LoC and files that changed. Have we considered splitting this PR in smaller ones? I know it's the top of the stack, a lot needs to happen for this one to get merged. But just throwing it out there to start thinking about whether it's possible

@gastonfournier gastonfournier moved this from New to In Progress in Issues and PRs Nov 6, 2026
@alexanto
alexanto force-pushed the feat/async-transport branch from 57aa024 to 54cafb8 Compare November 6, 2026 08:06
@alexanto
alexanto requested review from ppicom and a balanced review from Copilot November 6, 2026 09:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Async transport validation rejects valid coroutine-returning methods wrapped by synchronous decorators, causing AsyncUnleashClient construction to fail before any request.

1 open issue
What changed in this PR

Extends public transport customization to AsyncUnleashClient, matching the synchronous client’s support for user-managed sessions and alternative HTTP libraries.

Changes:

  • Exposes async transports and adds constructor validation.
  • Adds custom aiohttp sessions, headers, and explicit resource ownership.
  • Expands tests, documentation, and examples for async transport usage.
File Description
UnleashClient/​transport.py Shares transport validation and authorization-header checks.
UnleashClient/​clients/​unleash_client.py Uses shared transport validation.
UnleashClient/​clients/​async_unleash_client.py Accepts and validates custom async transports.
UnleashClient/​_async_unleash_api_client.py Looks up response ETags case-insensitively.
UnleashClient/​_aiohttp_transport.py Supports user sessions, custom headers, and ownership-aware cleanup.
UnleashClient/​__init__.py Exports async transport interfaces and implementation.
tests/​unit_tests/​test_aiohttp_transport.py Tests session ownership, headers, and response handling.
tests/​unit_tests/​clients/​test_async_unleash_client_transport.py Tests transport integration, validation, and examples.
README.md Documents async transport configuration and lifecycle.
examples/​httpx_async_transport.py Demonstrates an httpx-backed async transport.
examples/​fake_async_transport.py Demonstrates async testing without a server.
CHANGELOG.md Records public async transport support.

Review effort: Balanced

Comment thread UnleashClient/transport.py Resolved
@alexanto

alexanto commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi there! I haven't looked at the code, just at the number of LoC and files that changed. Have we considered splitting this PR in smaller ones? I know it's the top of the stack, a lot needs to happen for this one to get merged. But just throwing it out there to start thinking about whether it's possible

i rebased it so it appears much smaller and the actual code is change is ~200 lines, the rest is just tests and changelog, so i hope it is not that horrible now

@alexanto
alexanto force-pushed the feat/async-transport branch from ced2eba to 3d7e4d9 Compare November 6, 2026 13:04

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants