Skip to content

Add non-generic TaskCompletionSource#37452

Merged
stephentoub merged 1 commit intodotnet:masterfrom
stephentoub:nongenerictcs
Jun 5, 2020
Merged

Add non-generic TaskCompletionSource#37452
stephentoub merged 1 commit intodotnet:masterfrom
stephentoub:nongenerictcs

Conversation

@stephentoub
Copy link
Member

@stephentoub stephentoub commented Jun 4, 2020

  • Adds the type, almost an exact copy of TaskCompletionSource<TResult>, but creating a Task instead of a Task<TResult>. Primary benefits here are symmetry, smaller Task object, and not forcing a developer to specify an unnecessary type name.
  • Adds tests for both TCS and TCS<TResult>.
  • Switches a bunch of usage of the generic type over to the non-generic, both in src and tests.

Fixes #17393

@stephentoub stephentoub added this to the 5.0 milestone Jun 4, 2020
@stephentoub stephentoub requested a review from a team June 4, 2020 21:42
@ghost
Copy link

ghost commented Jun 4, 2020

Tagging subscribers to this area: @tarekgh
Notify danmosemsft if you want to be subscribed.

@Dotnet-GitSync-Bot
Copy link
Collaborator

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Copy link
Contributor

@scalablecory scalablecory left a comment

Choose a reason for hiding this comment

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

Satisfying change :).

- Adds the type, almost an exact copy of `TaskCompletionSource<TResult>`, but creating a `Task` instead of a `Task<TResult>`.  Primary benefits here are symmetry, smaller `Task` object, and not forcing a developer to specify an unnecessary type name.
- Adds tests for both TCS and TCS<TResult>.
- Switches a bunch of usage of the generic type over to the non-generic, both in src and tests.
@stephentoub stephentoub merged commit 1705e68 into dotnet:master Jun 5, 2020
@stephentoub stephentoub deleted the nongenerictcs branch June 5, 2020 14:50
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non value returning TaskCompletionSource

4 participants