Apply API changes for RequestCircuitPauseAsync#67045
Open
ilonatommy wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the server-side Blazor circuit pause API shape and aligns the JS client hook to support cancellation when the circuit is torn down, based on the API feedback in the linked issue.
Changes:
- Changed
Circuit.RequestCircuitPauseAsync(and internalCircuitHost.RequestPauseAsync) fromValueTask<bool>toTask<bool>and updated call sites/tests accordingly. - Updated the JS
CircuitStartOptions.onPauseRequestedcallback signature to accept anAbortSignaland allow synchronous (void) or async (Promise<void>) completion. - Added client-side aborting of the pause-deferral work during
CircuitManager.dispose().
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Components/Web.JS/src/Platform/Circuits/CircuitStartOptions.ts | Updates onPauseRequested typing to accept AbortSignal and allow sync/async completion. |
| src/Components/Web.JS/src/Platform/Circuits/CircuitManager.ts | Creates/aborts an AbortController for pause deferral and passes the signal into onPauseRequested. |
| src/Components/Server/test/Circuits/CircuitHostTest.cs | Updates tests to match the new Task<bool> return type. |
| src/Components/Server/src/PublicAPI.Unshipped.txt | Updates the declared public API signature to Task<bool>. |
| src/Components/Server/src/Circuits/CircuitHost.cs | Changes internal pause request method to Task<bool> and returns the dispatcher task directly. |
| src/Components/Server/src/Circuits/Circuit.cs | Updates public API to return Task<bool> and delegates to CircuitHost. |
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.
Suggestions: #66798 (comment)
ValueTaskto aTaskAbortSignalto stop the "pause deferring" work when connection is being teared down.aspnetcore/src/Components/Web.JS/src/Platform/Circuits/CircuitStartOptions.ts
Line 23 in b8f35c2
This remark was based on stale method snippet, from before Implement
Circuit.RequestCircuitPauseAsync#66265 (comment) design discussion.Fixes #65062