Repository navigation
Conversation
|
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 |
57aa024 to
54cafb8
Compare
There was a problem hiding this comment.
🟡 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
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 |
ced2eba to
3d7e4d9
Compare
for more information, see https://pre-commit.ci

async ounterpart of #473