Is it possible to “await yield return DoSomethingAsync()”

前端 未结 9 954
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-27 14:08

Are regular iterator blocks (i.e. \"yield return\") incompatible with \"async\" and \"await\"?

This gives a good idea of what I\'m trying to do:

asyn         


        
9条回答
  •  佛祖请我去吃肉
    2020-11-27 14:40

    Yield does not work with await, unfortunately. But this is what Rx is for. Check out https://msdn.microsoft.com/library/hh242985

提交回复
热议问题