Open
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds async wait handler support to the IAwaitableCallback<TValue> interface by introducing a new WaitAsync method. The changes enable asynchronous waiting for callbacks using modern async/await patterns with cancellation token support.
Changes:
- Added
WaitAsyncmethod toIAwaitableCallback<TValue>for asynchronous waiting with cancellation support - Refactored the interface to change the generic constraint from
out TValue(covariant) toTValue(invariant) to support returning arrays - Marked the old
ExecuteWhileWaitingmethods as obsolete, encouraging users to execute callbacks before calling Wait/WaitAsync - Implemented channel-based async infrastructure using
System.Threading.Channelsfor efficient value buffering - Added comprehensive test coverage for the new WaitAsync functionality
- Updated API surface files across all target frameworks (.NET 6.0, 8.0, 9.0, 10.0, netstandard2.0, netstandard2.1)
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/Testably.Abstractions.Testing/IAwaitableCallback.cs | Added new WaitAsync method and updated Wait method signatures; changed generic constraint from covariant to invariant |
| Source/Testably.Abstractions.Testing/Notification.cs | Implemented channel-based async infrastructure with WaitAsync support; marked ExecuteWhileWaiting as obsolete |
| Source/Testably.Abstractions.Testing/AwaitableCallbackExtensions.cs | New extension methods providing backward-compatible overloads for Wait/WaitAsync with int timeout parameters |
| Source/Testably.Abstractions.Testing/Helpers/ExceptionFactory.cs | Added TimeSpan overload for TimeoutExpired exception factory method |
| Tests/Testably.Abstractions.Testing.Tests/NotificationTests.cs | Updated existing tests to use new API, marked obsolete filter tests with Obsolete attribute |
| Tests/Testably.Abstractions.Testing.Tests/NotificationTests.WaitAsync.cs | New test file with comprehensive WaitAsync test coverage including cancellation, disposal, and multiple wait scenarios |
| Tests/Testably.Abstractions.Testing.Tests/NotificationHandlerExtensionsTests.cs | Refactored tests to execute callbacks before Wait instead of using ExecuteWhileWaiting |
| Tests/Testably.Abstractions.Testing.Tests/FileSystem/ChangeHandlerTests.cs | Updated tests to use new Wait API pattern |
| Tests/Api/Testably.Abstractions.Api.Tests/Expected/*.txt | Updated API surface files for all target frameworks to reflect new public API |
d11fe3e to
5993198
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.



This pull request adds async wait handler support to the
IAwaitableCallback<TValue>interface by introducing a newWaitAsyncmethod. The changes enable asynchronous waiting for callbacks using modern async/await patterns with cancellation token support.Key Changes:
WaitAsyncmethod toIAwaitableCallback<TValue>for asynchronous waiting with cancellation supportout TValue(covariant) toTValue(invariant) to support returning arraysExecuteWhileWaitingmethods as obsolete, encouraging users to execute callbacks before calling Wait/WaitAsyncSystem.Threading.Channelsfor efficient value buffering