-
Notifications
You must be signed in to change notification settings - Fork 773
Preparing for System.Linq.AsyncEnumerable #2240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
idg10
wants to merge
23
commits into
main
Choose a base branch
from
feature/2239-sys-linq-async-replacement
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
The main job at this stage was to ensure it can still compile. This starts the job of separating out the duplicated and different APIs, but most of that remains to be done.
Turns out the solution doesn't build the ref assemblies and they weren't building. I also needed to modify the async code generator to correctly handle #if-ed out code. Turns out it was stripping the directives and then copying the disabled block of text in as leading trivia! This had the effect of copying #if-ed out methods into the generated code, making them reappear. I've also worked through the first four files of operators.
This is more complex than anything else so far for a couple of reasons. First this uses T4 templates to generate code which in turn contains the [GenerateAsyncOverload] attribute, so we have two levels of code generation. Second, System.Linq.AsyncEnumerable has elected not to implement all of the functionality available in System.Linq.Async (e.g. overloads taking selector callbacks).
Fix erroneous doc comment on ZIP
The ref System.Linq.Async had different frameworks from the runtime one! System.Interactive.Async now has responsibility for supplying the transitive dependency on Microsoft.Bcl.AsyncInterfaces when required. (System.Linq.Async used to do this, but we've inverted the dependency between these tow packages, and also we want people to stop using System.Linq.Async. Now that System.Interactive.Async is the leaf of the dependency tree, it's the one that has to add this reference.) Also, I've added comments explaining why some projects have net10.0 but not net8.0 targets. (Since I very nearly incorrectly reverted that in a review just now, I think it's safe to say the reason behind this isn't entirely self-evident.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[area] Ix
System.Linq.Async deprecation
Replacing `System.Linq.Async` with the .NET class library's `System.Linq.AsyncEnumerable`
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.
.NET 10 includes
System.Linq.AsyncEnumerable
(and this is available for older .NET runtimes as a NuGet package). This provides LINQ forIAsyncEnumerable<T>
, which is the primary raison d'être of theSystem.Linq.Async
package that is built as part of Ix.NET.The current version of
System.Linq.Async
(v6) causes problems if you use it in a project whereSystem.Linq.AsyncEnumerable
is also in use (e.g., any .NET 10.0 project).This modifies
System.Linq.Async
to enable it to coexist withSystem.Linq.AsyncEnumerable
(by removing most of the functionality from the public API visible in its ref assemblies, while leaving everything present in the runtime assemblies for binary compatibility). The small amount of functionality inSystem.Linq.Async
that has not been recreated inSystem.Linq.AsyncEnumerable
moves intoSystem.Interactive.Async
. The goal is for projects to be able to removeSystem.Linq.Async
, and for us to deprecate this package.The various oddly-named overloads that take async callbacks (with suffixes such as
Await
andWithCancellation
) remain but have been marked as[Obsolete]
with messages recommending that the developer move over to their more conventionally named equivalents fromSystem.Linq.AsyncEnumerable
.