Obsolete messages explain CancellationToken change #2286
Merged
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.
Resolves #2284
As #2283 reported, there is a trap waiting for those who were using the
Awaitforms available for various operators in Ix.NET's LINQ toIAsyncEnumerable<T>(System.Linq.Async) when they upgrade to the .NET runtime library implementation (System.Linq.AsyncEnumerable).Our preview builds provide
Obsoleteattributes explaining that you need to move from, e.g.,SelectAwaittoSelect, but the message did not mention that you will also need to change the callback signature. Whereas Ix.NET's implementation allowed you to pass a callback that does not take a cancellation token (and cancellation was available through methods with a completely different name such asSelectAwaitWithCancellation), the .NET runtime's implementation requires async callbacks to accept aCancellationToken.So something like this:
needs two changes:
SelectAwaitwithSelectCancellationTokenSo at a minimum, that means something like this:
That need to add the extra parameter to accept the
CancellationTokenwas not obvious.This modifies the
Obsoleteattributes to include instructions to this effect.