Async IObservable enumerator
-
2012年2月13日 3:44
I wonder if an extension method exists that could be used like this:
IObservable<T> observable = ...
IAsyncEnumerator<T> enumerator = observable.GetAsyncEnumerator();while(await enumerator.MoveNext()) // Could rethrow OnError() exception { T current = enumerator.Current; }
全部回复
-
2012年2月13日 4:08I'd expect it would be called;
observable.ToAsyncEnumerable()James Miles http://enumeratethis.com
-
2012年2月13日 4:25
Just checked. It's already in "Interactive Extensions" in the System.Interactive.Async.dll
public static IAsyncEnumerable<TSource> ToAsyncEnumerable<TSource>(this IObservable<TSource> source)
James Miles http://enumeratethis.com
- 已建议为答案 Dave Sexton 2012年2月13日 4:31
- 已标记为答案 Tamas Flamich 2012年2月13日 13:02
-
2012年2月13日 13:10
Do you mean this? What is the point of separating features?
http://www.microsoft.com/download/en/details.aspx?id=27203
Does a stable release exist? I read something about that Rx and Ix was not separated before.
-
2012年2月13日 19:30
Ok, I found out that the stable version of Rx includes Ix too:
http://www.microsoft.com/download/en/details.aspx?id=24940 -
2012年2月13日 20:18
Hi,
Edit: Yes, it appears that your first link is the latest Ix release.
Your second link is a very old version of Rx. It's not the official stable release.
Currently, Ix is only available in a separate assembly that is considered "experimental".
- Dave
- 已编辑 Dave Sexton 2012年2月13日 20:22 Added confirmation

