- ASP.NET Core 2 High Performance(Second Edition)
- James Singleton
- 126字
- 2021-07-08 09:38:58
Asynchronous availability
Another small improvement is that you can use the await keyword inside catch and finally blocks. This was not initially allowed when this incredibly useful feature was added to C# 5. There is not a lot more to say about this. The implementation is complex, but you don't need to worry about this unless you're interested in the internals. From a developer's point of view, it just works, as in this simple example:
catch (Exception e) when (e?.Message?.Length > 0)
{
await Task.Delay(200);
}
This feature has been improved in C# 7, so read on. You will see async and await used a lot throughout this book. Asynchronous programming is a great way of improving performance and not just from within your C# code.
推薦閱讀
- OpenStack Cloud Computing Cookbook(Fourth Edition)
- Python機器學習實戰
- Lighttpd源碼分析
- Python極簡講義:一本書入門數據分析與機器學習
- Microsoft Dynamics AX 2012 R3 Financial Management
- 0 bug:C/C++商用工程之道
- JavaScript腳本特效編程給力起飛
- Hands-On JavaScript for Python Developers
- Python 快速入門(第3版)
- Spring Web Services 2 Cookbook
- Spring Boot 3:入門與應用實戰
- Mastering Clojure
- Mastering Node.js
- Oracle 11g寶典
- Java EE 7 First Look