Repository navigation
feat(feature-flags): Add an async feature flags runtime client - #766
Merged
Merged
Conversation
This was referenced Nov 4, 2026
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryAdds
Reviews (6) · Last reviewed commit: "fix(feature-flags): Make every async clo..." · Reviewed by Greptile |
Contributor
Author
|
@greptileai review |
Contributor
Author
|
@greptileai review |
gjtorikian
approved these changes
Nov 4, 2026
Contributor
Author
|
@greptileai review |
Deborah-Digges
approved these changes
Nov 4, 2026
stanleyphu
force-pushed
the
feat/feature-flags-runtime-sync-client
branch
from
November 4, 2026 23:43
1980d27 to
3437e7d
Compare
stanleyphu
force-pushed
the
feat/feature-flags-runtime-async-client
branch
from
November 4, 2026 23:43
73ce16b to
097d9bf
Compare
Contributor
Author
|
@greptileai review |
Base automatically changed from
feat/feature-flags-runtime-sync-client
to
main
November 5, 2026 00:33
AsyncFeatureFlagsRuntimeClient, from AsyncWorkOSClient, polls in an asyncio task with the same evaluation, retries, listeners and status as the sync client. Evaluation stays synchronous, and listeners may be coroutines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…from within A coroutine listener that awaited work something else cancelled raised CancelledError, which skipped the remaining listeners and ended the polling task for good. Each coroutine listener now runs in a task of its own: its own cancellation is logged like a listener error, and cancelling the delivering task, as close() does, still cancels the listener. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to stop A second close() returned as soon as it saw the client was closed, while the first was still waiting for the polling task and a listener's cleanup, so the second caller could close shared resources too early. Every caller now waits for the polling task, which is cancelled only once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stanleyphu
force-pushed
the
feat/feature-flags-runtime-async-client
branch
from
November 5, 2026 00:35
097d9bf to
28a35f6
Compare
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.
Stack. This is #762, split into four PRs for review. Merge them in order; after each merge I'll rebase the next one onto
main.Description
AsyncFeatureFlagsRuntimeClient, created fromAsyncWorkOSClient, polls in an asyncio task. It has the same evaluation, retries, listeners and status as the sync client in #765.AsyncWorkOSClient's ownrequest()withmax_retries: 0, so retries follow the runtime client's policy.asyncio.wait_forenforcesrequest_timeoutexactly.CancelledErrorinside one only ends that listener and polling continues.close()cancels the polling task, and any listener it's running, and waits for it to finish. Every caller waits, including concurrent ones. Whenclose()is called from a listener running inside that task, it doesn't wait, because the task exits once the listener returns.Where to look:
_async.pymirrors_sync.pymethod for method, so reading them side by side is quickest. The real differences are_fetchand_refresh_locked(timeouts) and_drain,_deliverand_await_listener(running coroutine listeners).How I checked it:
nox -s cipasses locally: 3,715 tests.Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
The docs PR noted on #765 covers this client too.
🤖 Generated with Claude Code