Skip to content

Conversation

BillWagner
Copy link
Member

Add and update the description of AsyncMethodBuilder, and the new feature that it can be applied to a method.

Fixes #24950

See issue #24972 to track the remaining task.

Notes on changes are on the issue: #24950 (comment)

Add and update the description of AsyncMethodBuilder, and the new feature that it can be applied to a method.
@BillWagner BillWagner requested a review from tdykstra July 2, 2021 19:25
Copy link
Contributor

@tdykstra tdykstra left a comment

Choose a reason for hiding this comment

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

LGTM, one question -- I didn't see a high-level intro discussion that would explain under what circumstances / in what scenarios you need to use the builder attribute rather than just use a Task return type.


The `Conditional` attribute is often used with the `DEBUG` identifier to enable trace and logging features for debug builds but not in release builds, as shown in the following example:

:::code language="csharp" source="snippets/ConditionalExamples.cs" id="SnippetConditional" :::
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the motivation for changing id to ID? Our guidance in the contributor guide uses lowercase.

Copy link
Member Author

Choose a reason for hiding this comment

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

@tdykstra Acrolinx marks down "id" in favor of "ID". Enough samples, and it has a measurable effect on the score.

Should I ping @MonicaRush on that one? (I'd honestly thought the guidance had changed when it kept getting flagged)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this should count as a false positive, Acrolinx shouldn't be applying general text rules to triple-colon statements.

@BillWagner BillWagner merged commit 36e7991 into dotnet:main Jul 6, 2021
@BillWagner
Copy link
Member Author

@tdykstra

I didn't see a high-level intro discussion that would explain under what circumstances / in what scenarios you need to use the builder attribute rather than just use a Task return type.

I'll address that as part of #24972

@BillWagner BillWagner deleted the async-method-builder branch July 6, 2021 18:32
@BillWagner BillWagner added the okr-freshness OKR: Freshness of content label Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

okr-freshness OKR: Freshness of content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow AsyncMethodBuilder() attribute on methods

2 participants