官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 富锦市| 错那县| 华坪县| 临汾市| 三门县| 永康市| 彩票| 文山县| 永春县| 乌鲁木齐市| 芷江| 扶风县| 岱山县| 慈利县| 宣化县| 阜宁县| 沁源县| 新津县| 张北县| 清流县| 海口市| 永昌县| 丰县| 扎鲁特旗| 思南县| 拉萨市| 香港 | 扎赉特旗| 伊宁县| 北票市| 稷山县| 通辽市| 谢通门县| 息烽县| 凤凰县| 永安市| 阿尔山市| 达拉特旗| 克什克腾旗| 关岭| 青川县|