- 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.
推薦閱讀
- Bootstrap Site Blueprints Volume II
- Apache ZooKeeper Essentials
- Web Application Development with R Using Shiny(Second Edition)
- Spring Cloud、Nginx高并發核心編程
- Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
- PLC編程及應用實戰
- Linux操作系統基礎案例教程
- 區塊鏈架構之美:從比特幣、以太坊、超級賬本看區塊鏈架構設計
- Julia High Performance(Second Edition)
- Getting Started with Electronic Projects
- Python Penetration Testing Essentials
- Python高性能編程(第2版)
- Java服務端研發知識圖譜
- HTML5程序開發范例寶典
- Spark for Data Science