Publish()不起作用 [英] Publish() doesn't work

查看:135
本文介绍了Publish()不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只接受一个参数(同质类型主题)的Publish()版本没有实现它所假设的语义。我查看了代码(在ILSpy的帮助下),结果发现这个版本的Publish只是将主题
订阅到源RIGHT AWAY,然后返回subject.AsObservable()。
The version of Publish() that takes just one argument (homogeneously-typed subject) doesn't implement it's supposed semantics. I've looked into the code (with some help from ILSpy), and it turns out that this version of Publish simply subscribes the subject to the source RIGHT AWAY, and then returns subject.AsObservable().

推荐答案

好的,第二个想法,结果证明我错了。 Publish()的另一个重载也不起作用。只有它不能以不同的方式工作:它实际上与订阅一样多的Multicast() - s。这几乎打败了
Multicast()的整个想法。
Ok, on second thought, turns out I was wrong. The other overload of Publish() doesn't work as well. Only it doesn't work in a different way: it actually does as many Multicast()-s as there are subscriptions. Which pretty much defeats the whole idea of Multicast().


这篇关于Publish()不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆