Rx IObservable:如何制作具体的推送集合?

发布于 2024-10-18 10:03:11 字数 106 浏览 2 评论 0原文

IEnumerable 有无数种具体实现:ListDictionary 等。IObservable 有哪些具体实现?

There are zillions of concrete implementations of IEnumerable: List<T>, Dictionary<T>, etc. What concrete implementations of IObservable are available?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夜血缘 2024-10-25 10:03:11

Rx 的 ISubject 实现是 IObservable 接口的一些最常见的实现。主题类列表包括:

Subject<T>
AsyncSubject<T>
BehaviorSubject<T>
ReplaySubject<T>

新的

FastSubject<T>
FastAsyncSubject<T>
FastBehaviorSubject<T>
FastReplaySubject<T>

主题类表示实现 IObservableIObserver 的对象,并在 Rx 的整个内部工作过程中使用图书馆。如果您正在创建自己的扩展方法,它们也非常宝贵。您可以在我的 最近关于该主题的问题(无双关语)。

正如 Mauricio Scheffer 提到的,更常见的是使用 Observable 类静态方法和 IObservable 扩展方法(System.Linq 命名空间)来检索 IObservable 实例。 EM>

Rx's ISubject implementations are some of the most common implementations of the IObservable interface. The list of the subject classes include:

Subject<T>
AsyncSubject<T>
BehaviorSubject<T>
ReplaySubject<T>

and the new

FastSubject<T>
FastAsyncSubject<T>
FastBehaviorSubject<T>
FastReplaySubject<T>

Subject classes represent objects that implement IObservable<T> and IObserver<T> and are used throughout the inner workings of the Rx library. They are also pretty invaluable if you are creating your own extention methods. You can find an explanation of each of these implementations on my recent question on the subject (no pun intended).

As Mauricio Scheffer mentioned, it is more commmon to use the Observable classes static methods and IObservable extention methods (System.Linq namespace) to retrieve IObservable instances.

活泼老夫 2024-10-25 10:03:11

IObservable 有哪些具体实现可用?

AnonymousObservable(内部)、ConnectableObservableListObservable...

但创建 IObservables 最常见的方法是通过 System.Reactive 的函数和扩展方法(例如 ToObservable())(示例)

What concrete implementations of IObservable are available?

AnonymousObservable<T> (internal), ConnectableObservable<T>, ListObservable<T>...

But the most common way to create IObservables is through System.Reactive's functions and extension methods (e.g. ToObservable()) (example)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文