Thread returning to thread pool when using await

前端 未结 2 1456
闹比i
闹比i 2021-01-25 21:49

However, with ASP.NET Web Api, if your request is coming in on one thread, and you await some function and call ConfigureAwait(false)

2条回答
  •  [愿得一人]
    2021-01-25 22:16

    What's am I missing here?

    You are missing compiler warnings

    Warning CS1998 This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

提交回复
热议问题