Async IObservable enumerator
-
lunedì 13 febbraio 2012 03: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; }
Tutte le risposte
-
lunedì 13 febbraio 2012 04:08I'd expect it would be called;
observable.ToAsyncEnumerable()James Miles http://enumeratethis.com
-
lunedì 13 febbraio 2012 04: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
- Proposto come risposta Dave Sexton lunedì 13 febbraio 2012 04:31
- Contrassegnato come risposta Tamas Flamich lunedì 13 febbraio 2012 13:02
-
lunedì 13 febbraio 2012 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.
-
lunedì 13 febbraio 2012 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 -
lunedì 13 febbraio 2012 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
- Modificato Dave Sexton lunedì 13 febbraio 2012 20:22 Added confirmation

