Reactive Rx 2.0 EventLoopScheduler ObjectDisposedException after dispose

后端 未结 3 1341
無奈伤痛
無奈伤痛 2021-01-06 11:15

I\'m using Rx 2.0\'s EventLoopScheduler to queue up / serialize work. When I need to dispose the scheduler, if there is remaining work, I will receive an unhandled ObjectDis

3条回答
  •  迷失自我
    2021-01-06 11:51

    It's not that there is work remaining (i.e. the scheduler still has things in its queue), it's that you still have Subscriptions outstanding that are trying to add stuff to that queue.

    Dispose all of the Subscriptions and then dispose the Scheduler, and it should work correctly

提交回复
热议问题