是否有可能将IObservable 转换为IAsyncEnumerable ] >> 我有一个可观察的IObservable<T> / ISubject<T>,并想通过使用SignalR将其返回。 SignalR具有异步流的概念,您必须在其中返回IAsyncEnumerable<T>。 如何将IObservable<T>转换为IAsyncEnumerable<T>? 我有一个可观察的IObservable / ISubject ,并想通过使用SignalR返回它。 SignalR具有异步流的概念,您必须在其中返回IAsyncEnumerable 。 ...

问题描述 投票:1回答:1

我有一个可观察的IObservable<T> / ISubject<T>,并想通过使用SignalR将其返回。 SignalR具有异步流的概念,您必须在其中返回IAsyncEnumerable<T>

如何将IObservable<T>转换为IAsyncEnumerable<T>

我有一个可观察的IObservable / ISubject ,并想通过使用SignalR返回它。 SignalR具有异步流的概念,您必须在其中返回IAsyncEnumerable 。 ...

c# signalr system.reactive iasyncenumerable
1个回答
0
投票

ToAsyncEnumerable程序集中有一个System.Linq.Async扩展方法,可以作为NuGet包here使用。

public static IAsyncEnumerable<TSource> ToAsyncEnumerable<TSource>(
    this IObservable<TSource> source);
© www.soinside.com 2019 - 2024. All rights reserved.