-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
43e9685
to
d3de70b
Compare
@dotnet/roslyn-compiler for second review. Thanks |
1 similar comment
@dotnet/roslyn-compiler for second review. Thanks |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
- add one,
- use -1 as a "no value"
- switch to
WellKnownMember? member
and adjust callers to usenull
as default value - leave as-is
I'll experiment tonight. Thanks
In reply to: 238452132 [](ancestors = 238452132)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to WellKnownMember?
approach
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), calledAsyncIteratorMethodBuilder
. It is very similar toAsyncVoidMethodBuilder
, but hasMoveNext
instead ofStart
andComplete
instead ofSetResult
.See BCL APIs: dotnet/corefx#33104