Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# async await implementation [closed]

I have some doubts about the design of C#'s upcoming async/await feature.

  1. The convenience of attaching the new mechanism to Task<T>
  2. I think is better to use async substituting the await keyword. For expaple: var result = async GetResultAsync();
  3. The mechanism to cancel a ongoing async operation using a token is not as elegant as I feel it could be.

Async/away is a great feature, but I think it's not as well designed as LINQ. Also, I feel the desing team is dangerously pleased with the current design; and might not take community feedback into account.

What do you think?

like image 721
Masterile Avatar asked Feb 22 '26 06:02

Masterile


2 Answers

These kind of design decisions tend to make little sense until you've tried to make this work yourself. Your assignment: write asynchronous code and make it stop whenever you want to. Your constraints: you cannot use Thread.Abort() and can never cause deadlock.

like image 55
Hans Passant Avatar answered Feb 23 '26 19:02

Hans Passant


Async/away is a great feature, but I think it's not as well designed as LINQ.

What aspects of the design process do you feel are deficient compared to the design process for LINQ?

Also, I feel the design team is dangerously pleased with the current design; and might not take community feedback into account.

What gives you that impression? We've been inviting community feedback for quite some time now. It is not being ignored.

What do you think?

I think this is a discussion question and not an engineering question. Are you sure this is the right site for this question?

like image 43
Eric Lippert Avatar answered Feb 23 '26 20:02

Eric Lippert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!