Skip to content
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

Async-streams: use ManualResetValueTaskSourceCore and AsyncIteratorMethodBuilder types #31330

Merged
merged 4 commits into from
Dec 4, 2018

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Nov 24, 2018

The feature was developed using a slightly different helper (ManualResetValueTaskSourceLogic, which depended on IStrongBox). THe BCL added ManualResetValueTaskSourceCore instead, which is largely the same API, except that it no longer needs IStrongBox.
Also, the BCL will be adding a builder type (which does not allocate Task instances, since we don't need them for async-iterators), called AsyncIteratorMethodBuilder. It is very similar to AsyncVoidMethodBuilder, but has MoveNext instead of Start and Complete instead of SetResult.

See BCL APIs: dotnet/corefx#33104

@jcouv jcouv added this to the 16.0.P2 milestone Nov 24, 2018
@jcouv jcouv self-assigned this Nov 24, 2018
@jcouv jcouv requested a review from a team as a code owner November 24, 2018 19:57
@jcouv jcouv force-pushed the bcl-types branch 3 times, most recently from 43e9685 to d3de70b Compare November 24, 2018 23:57
@jcouv
Copy link
Member Author

jcouv commented Nov 27, 2018

@dotnet/roslyn-compiler for second review. Thanks

1 similar comment
@jcouv
Copy link
Member Author

jcouv commented Nov 28, 2018

@dotnet/roslyn-compiler for second review. Thanks

Copy link
Member

@agocke agocke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -350,6 +384,12 @@ private static NamedTypeSymbol ValidateBuilderType(SyntheticBoundNodeFactory F,
out TSymbol symbol)
where TSymbol : Symbol
{
if (member == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't know what (WellKnownMember)0 is, aside from the default. Is there a name for this member?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. It's System_Math__RoundDouble (looks like we don't have a Default or None)
Some options:

  1. add one,
  2. use -1 as a "no value"
  3. switch to WellKnownMember? member and adjust callers to use null as default value
  4. leave as-is

I'll experiment tonight. Thanks


In reply to: 238452132 [](ancestors = 238452132)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to WellKnownMember? approach

@jcouv jcouv merged commit 9dcc089 into dotnet:master Dec 4, 2018
@jcouv jcouv deleted the bcl-types branch December 4, 2018 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants