Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9053851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:31:51+00:00 2026-06-16T13:31:51+00:00

Task or Task<TResult> object is awaitable, so we can use await key on those

  • 0

Task or Task<TResult> object is awaitable, so we can use await key on those whose return value is Task or Task<TResult>.
Task or Task<TResult> are the most frequently-used awaitable object.

We also can define our own awaitable object.The object should has below qualification.

  1. It has a GetAwaiter() method (instance method or extension method);
  2. Its GetAwaiter() method returns an awaiter. An object is an awaiter
    if:

    • It implements INotifyCompletion or ICriticalNotifyCompletion
      interface;
    • It has an IsCompleted, which has a getter and returns a Boolean;
    • it has a GetResult() method, which returns void, or a result.

My question is that why Microsoft didn’t provide a interface to constrain these awaitable object?
The current method to implement awaitable object is a little complicated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:31:52+00:00Added an answer on June 16, 2026 at 1:31 pm

    It is best answered in Lucian Wischik’s blog post Why must async methods return Task?

    In summary (and I am not doing the blog post justice, you should read it), the issue is that Task already exists, so introducing an interface would mean

    • All the internal methods would need to be changed to the interface, a break change and thus almost impossible for the framework people to willingly do.
    • As a programmer you would constantly need to decide if you want to return Task or the interface, a decision that doesn’t matter much.
    • The compiler would always need a concrete type, so even if you returned an interface from a method then it would still be compiled as Task.

    The impact from the above is so massive that it doesn’t make sense to provide an interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I run a Task that return value and takes a parameter? I
With System.Threading.Tasks.Task<TResult> , I have to manage the exceptions that could be thrown. I'm
I've got a Task<T>: Task<A> someTask = ... This task can result in being
If an async method declared with async has a return type of Task or
In Async/Await FAQ , Stephen Toub says: An awaitable is any type that exposes
Given the following method: public async Task<MyObject> DoSomethingAsync() { // do some work await
In my use of the Task Parallel Library in .net 4.0 I am wondering
I want to return a photo using PhotoChooserTask like this: private void getimage_Click(object sender,
Task: To provide facility to upgrade the system remotely or add new features. What
Task at hand — I have three versions of some code, developed by different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.