Why doesn't the Task.Delay
method have Async
suffix?
#59761
-
I wonder why Thank you |
Beta Was this translation helpful? Give feedback.
Answered by
stephentoub
Sep 29, 2021
Replies: 1 comment
-
Because Task itself is about asynchrony and so it's deemed duplicative... effectively the "async" is built into the type, e.g. Task.Run isn't Task.RunAsync. Only when there's ambiguity, e.g. we added a synchronous Wait() method, have we used an Async suffix, e.g. WaitAsync. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kiminuo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because Task itself is about asynchrony and so it's deemed duplicative... effectively the "async" is built into the type, e.g. Task.Run isn't Task.RunAsync. Only when there's ambiguity, e.g. we added a synchronous Wait() method, have we used an Async suffix, e.g. WaitAsync.