C#异步编程由浅入深(三)细说Awaiter

Python微信订餐小程序课程视频

https://edu.csdn.net/course/detail/36074

Python实战量化交易理财系统

https://edu.csdn.net/course/detail/35475
  上一篇末尾提到了Awaiter这个类型,上一篇说了,能await的对象,必须包含GetAwaiter()方法,不清楚的朋友可以看上篇文章。那么,Awaiter到底有什么特别之处呢?
  首先,从上篇文章我们知道,一个Awaiter必须实现INotifyCompletion接口,这个接口定义如下:

Copynamespace System.Runtime.CompilerServices
{
    /// 
    /// Represents an operation that will schedule continuations when the operation completes.
    /// 
    public interface INotifyCompletion
    {
        /// Schedules the continuation action to be invoked when the instance completes.
        /// The action to invoke when the operation completes.
        /// The  argument is null (Nothing in Visual Basic).
        void OnCompleted(Action 
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值