feat: Add AsyncSSEClient with aiohttp-based async/await support#58
Open
feat: Add AsyncSSEClient with aiohttp-based async/await support#58
Conversation
Adds AsyncSSEClient as a purely additive new public API alongside the existing SSEClient. Async users install with the [async] extra to get aiohttp; sync users have no new dependencies. All existing tests pass unchanged. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Removes make_stream, retry_for_status, and no_delay from async_helpers.py as they were either unused or duplicates of the same functions in helpers.py. Updates async test files to import these from helpers.py consistently. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds AsyncSSEClient as a purely additive new public API alongside the
existing SSEClient. Async users install with the [async] extra to get
aiohttp; sync users have no new dependencies. All existing tests pass
unchanged.
Note
Medium Risk
Adds a new async client and HTTP stack (
aiohttp) with new retry/streaming behavior and contract-test infrastructure; although largely additive and behind an optional extra, it introduces new concurrency/resource-lifecycle paths that could affect reliability if misused.Overview
Adds a new public async/await SSE API (
AsyncSSEClient) built aroundaiohttp, including async stream parsing (_AsyncBufferedLineReader/_AsyncSSEReader), an async connection abstraction (AsyncConnectStrategy), and an async HTTP connector with header/query-param support and response validation.Updates packaging and docs to keep async dependencies optional (
launchdarkly-eventsource[async]) and lazily exposesAsyncSSEClientviald_eventsource.__getattr__to avoid importingaiohttpfor sync-only users.Extends test coverage and automation by adding pytest-asyncio-based unit tests, an async contract-test service (
contract-tests/async_service.py), Makefile targets, and CI steps to run the async contract tests; also mocksaiohttpduring doc builds.Written by Cursor Bugbot for commit 069bffe. This will update automatically on new commits. Configure here.