-
Notifications
You must be signed in to change notification settings - Fork 782
Using async/await in System.Interactive.Async #170
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
Conversation
|
Hi @aelij, can you please rebase this on to the |
|
Sure. Does it mean I'll need to open a new PR? |
|
@aelij if you rebase and force push to the same branch, it'll keep it associated with this PR |
|
Does this PR only contain async/await impls or does it also include things like |
|
Just async/await for current methods. |
|
I was about to do the same in the |
|
@onovotny, I'm trying to run the tests after the rebase with no success. The Test Explorer doesn't discover them, ReSharper won't run project.json test projects at all, and Any idea how to fix this? Thanks. |
|
For the code currently in BTW, on/after Monday, you'll want to run |
|
Can this wait until Monday? I'd rather not install nightlies :) |
|
Indeed, thanks! |
|
I've run the tests, and all of them pass except The question now is whether we take this breaking change and conform to the WDYT? |
|
@aelij Changing from |
|
I've force-pushed the branch. Cool, I see you've added CI builds! Regarding the |
|
Review status: all files reviewed at latest revision, 32 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Conversions.cs, line 102 [r3] (raw file):
So we should leave this as-is or undo this change? Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Single.cs, line 358 [r3] (raw file):
💄 Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Single.cs, line 392 [r3] (raw file):
💄 Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Single.cs, line 900 [r3] (raw file):
💄 do we need the Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Single.cs, line 1120 [r3] (raw file):
I think this is fine to leave here, as the old code using Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Single.cs, line 1232 [r3] (raw file):
Can we document why this is an important scenario to catch and rethrow explicitly, rather than fall through to the Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Single.cs, line 1299 [r3] (raw file):
This is an introduced Ix.NET/Source/System.Interactive.Async/EmptyArray.cs, line 1 [r3] (raw file):
As this is a new file, please use the new license header: Ix.NET/Source/System.Interactive.Async/Grouping.cs, line 1 [r3] (raw file):
As this is a new file, please use the new license header: Ix.NET/Source/System.Interactive.Async/Grouping.cs, line 9 [r3] (raw file):
Actually, this looks really familiar - if we're pulling in this from corefx can we link back and attribute accordingly? Something like this: /// adapted from System.Linq.Grouping from .NET Framework
/// source: https://github.com/dotnet/corefx/blob/b90532bc97b07234a7d18073819d019645285f1c/src/System.Linq/src/System/Linq/Grouping.cs#L64I've just used the latest commit on Ix.NET/Source/System.Interactive.Async/Lookup.cs, line 1 [r3] (raw file):
As this is a new file, please use the new license header: Ix.NET/Source/System.Interactive.Async/Lookup.cs, line 9 [r3] (raw file):
Same thing here - I'd like us to cite sources wherever appropriate for better visibility. I gather this is coming from CoreFx, and so we should use Ix.NET/Source/System.Interactive.Async/Strings.cs, line 10 [r3] (raw file):
Could we make this more user-friendly? cc @onovtny for feels Ix.NET/Source/System.Interactive.Async/TaskExt.cs, line 35 [r3] (raw file):
I'm not sure if external callers would have relied on this code (let alone should have), but given it is Ix.NET/Source/Tests/AsyncTests.Aggregates.cs, line 21 [r3] (raw file):
I'm not averse to putting timeouts here in the tests, especially where Ix.NET/Source/Tests/AsyncTests.cs, line 24 [r3] (raw file):
I don't see any usages of this. Shall we clean this up? Comments from Reviewable |
|
@aelij thanks for contributing this! Don't worry about the volume of comments I've added, that's just me trying to be thorough and ensure nothing slips through the review process. For the most part, the stuff I've raised is just cleanup jobs (prefixed with a 💄 emoji) but there's a few questions I have as well. |
|
Review status: all files reviewed at latest revision, 32 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Conversions.cs, line 102 [r3] (raw file):
|
|
Reviewed 6 of 13 files at r1, 9 of 15 files at r2, 6 of 6 files at r3. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Conversions.cs, line 102 [r3] (raw file):
|
|
@shiftkey I don't mind, although I would've done this in a separate PR (most of the 'lipsticks' existed in the original code). Regarding the 'var' changes, would anyone mind if I added a ReSharper rule (in a committed .DotSettings file)? Review status: all files reviewed at latest revision, 32 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Aggregates.cs, line 1623 [r3] (raw file):
|
|
Review status: all files reviewed at latest revision, 32 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Single.cs, line 900 [r3] (raw file):
|
|
@aelij 👍 Review status: all files reviewed at latest revision, 30 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Conversions.cs, line 23 [r3] (raw file):
|
|
There is already a solution level settings file for each project but that particular rule may not be set to always switch/use Review status: all files reviewed at latest revision, 29 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Aggregates.cs, line 1623 [r3] (raw file):
|
|
Review status: all files reviewed at latest revision, 29 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Conversions.cs, line 23 [r3] (raw file):
|
|
Review status: all files reviewed at latest revision, 28 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Conversions.cs, line 23 [r3] (raw file):
|
|
Reviewed 10 of 10 files at r4. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Creation.cs, line 80 [r4] (raw file):
.ConfigureAwait(false)? Ix.NET/Source/System.Interactive.Async/TaskExt.cs, line 13 [r4] (raw file):
Where is this still being used, and can we get rid of it? Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 30 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Creation.cs, line 80 [r4] (raw file):
|
|
Review status: all files reviewed at latest revision, 30 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Single.cs, line 1120 [r3] (raw file):
|
|
Review status: all files reviewed at latest revision, 30 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Creation.cs, line 80 [r4] (raw file):
|
|
Review status: all files reviewed at latest revision, 30 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Creation.cs, line 80 [r4] (raw file):
|
|
Review status: all files reviewed at latest revision, 30 unresolved discussions. Ix.NET/Source/System.Interactive.Async/AsyncEnumerable.Creation.cs, line 80 [r4] (raw file):
|
|
|
|
@aelij Thanks for your hard work here! |
|
@aelij done |
|
Thanks guys. It's been fun. Now it's time to start thinking about #194 :) |
Hi,
This PR is a precursor to implementing all the operators with async delegates. With async/await this will be very easy to implement. It also simplifies the code a great deal.
For example:
My motivation is the release of Service Fabric, which exposes its own
IAsyncEnumerable<T>interface. With a simple wrapper (such as the one here) it would be possible to useSystem.Interactive.Asyncwith it. Since SF reliable collections only expose an async enumerable, this is the only option to use LINQ. The async delegate versions of the operators are also very useful in cross-collection queries (as you can see in the aforementioned Gist).I realize this is a pretty big (unsolicited ;) change, but hopefully you'll consider it.
Eli.
This change is