gpt4 book ai didi

c# - .Net Reactive Extensions Framework (Rx) 是否考虑了拓扑顺序?

转载 作者:太空宇宙 更新时间:2023-11-03 13:14:27 24 4
gpt4 key购买 nike

.Net Reactive Extensions Framework 是否按拓扑顺序传播通知以最小化更新量?

就像 Scala Rx 那样:Does .Net Reactive Extensions (Rx) ta

最佳答案

.NET Rx 在实现 FRP 时使用了多种语义。关键点是可观察对象和订阅者上下文,尤其是订阅者使用的调度程序。

TL;DR - .NET RX 在调用通知时不使用拓扑顺序。

长答案:订阅者是按订阅顺序调用的。在并发感知调度程序的情况下,您可以使用方法 ObserveOn/SubscribeOn(更详细 explanation)实现并行调用。

编辑(感谢@DaveSexton):

Note that neither ObserveOn nor SubscribeOn achieve "parallel" notifications (unless you are comparing segments of the query on both sides of the operator). Note that neither ObserveOn nor SubscribeOn achieve "parallel" notifications (unless you are comparing segments of the query on both sides of the operator). Rx has a strict contract (§4.2) that prevents overlapping (concurrent) notifications within a single subscription, and for hot observables this contract generally applies across subscriptions as well.

关于c# - .Net Reactive Extensions Framework (Rx) 是否考虑了拓扑顺序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27064570/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com