f# – Observable.merge <'T>不是线程安全引起的意外后果的例子是什么?

documentation声明:

“For each observer, the registered intermediate observing object is not thread safe. That is, observations arising from the sources must not be triggered concurrently on different threads.”

这也适用于Observable.pairwise<‘T>和Observable.scan<‘U,’T>.

什么是Observable.merge的一个例子,它以一种产生意想不到的后果的方式使用,因为它不是线程安全的?

最佳答案 基于
source code,看起来如果观察者都在不同的线程上触发OnCompleted,那么合并的observable可能无法完成.

点赞