【发布时间】:2011-06-26 07:25:33
【问题描述】:
我有一个 Subject<T>,我通过 OnNext 将项目发布到其中,一段时间后,在负载下,我得到了这个异常:
System.NullReferenceException: Object reference not set to an instance of an object
at System.Diagnostics.ExceptionExtensions.PrepareForRethrow (System.Exception exception) [0x00000] in <filename unknown>:0
at System.Concurrency.AsyncLock.Wait (System.Action action) [0x00000] in <filename unknown>:0
at System.Concurrency.Scheduler+<>c__DisplayClass4.<Schedule>b__0 () [0x00000] in <filename unknown>:0
at System.Concurrency.ImmediateScheduler.Schedule (System.Action action) [0x00000] in <filename unknown>:0
at System.Concurrency.Scheduler.Schedule (IScheduler scheduler, System.Action`1 action) [0x00000] in <filename unknown>:0
at System.ScheduledObserver`1[GetNotifyd.Superfeedr.FeedItem].EnsureActive () [0x00000] in <filename unknown>:0
at System.Collections.Generic.Subject`1[GetNotifyd.Superfeedr.FeedItem].OnNext (GetNotifyd.Superfeedr.FeedItem value) [0x00000] in <filename unknown>:0
发生这种情况后,我仍然可以通过OnNext 发布项目,但我的订阅者不再收到任何东西。这是使用 MS 的 .NET 3.5 Reactive Extensions DLL 在单声道 2.10.1 下运行的(即我不认为它是正在消亡的单声道代码)。当我在 Windows 上尝试时,我没有看到这种情况发生,但我没有在那里运行相同的负载。 OnNext 的参数项肯定不为空,所以这不是原因。
知道是什么原因造成的,或者我可以如何恢复主题,还是我只需要创建一个新主题,通知我的所有订阅者订阅它?
因为它看起来像一个 Rx 问题,我也在 their forum 上报告了它
更新:issue was confirmed 作为我正在使用的版本组合的 Rx/mono 问题。升级到最新的 Rx (1.0.10605) 解决了这个问题。
【问题讨论】:
标签: c# mono system.reactive task-parallel-library