- 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.
推薦閱讀
- WildFly:New Features
- Java 9 Concurrency Cookbook(Second Edition)
- Implementing Cisco Networking Solutions
- Building Mapping Applications with QGIS
- OpenStack Orchestration
- Getting Started with Eclipse Juno
- Learning jQuery(Fourth Edition)
- Scala for Machine Learning(Second Edition)
- Visual Basic 6.0程序設計實驗教程
- Java Web應用開發給力起飛
- Application Development with Parse using iOS SDK
- 快樂編程:青少年思維訓練
- Learning ECMAScript 6
- 游戲設計的底層邏輯
- 每個人的Python:數學、算法和游戲編程訓練營