- 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.
推薦閱讀
- Boost C++ Application Development Cookbook(Second Edition)
- Building a Game with Unity and Blender
- Java從入門到精通(第5版)
- Magento 1.8 Development Cookbook
- UML 基礎(chǔ)與 Rose 建模案例(第3版)
- Python忍者秘籍
- 快速入門與進(jìn)階:Creo 4·0全實(shí)例精講
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)教程(Windows 7+Office 2010)
- 區(qū)塊鏈國產(chǎn)化實(shí)踐指南:基于Fabric 2.0
- C陷阱與缺陷
- Angular Design Patterns
- Visual Basic程序設(shè)計(jì)基礎(chǔ)
- Python面試通關(guān)寶典
- ArcPy and ArcGIS(Second Edition)
- Splunk Essentials