Publish(), Subject: pointing a scheduler

已答复 Publish(), Subject: pointing a scheduler

  • 2012年5月4日 14:16
     
     

    What is the reason why in latest RX release I am not able to point the scheduler for Publish() method or for Subject constructor? Any replacements for desired behavior: e.g. using ObserveOn instead?

    Thanks in advance.

全部回复

  • 2012年5月4日 16:00
     
     已答复

    Hi,

    You can use the static Subject.Synchronize method to apply a scheduler to a new Subject<T> and then pass the returned subject to the Multicast method, which is essentially what Publish does.

    Alternatively, you can use Publish followed by ObserveOn, which seems to avoid an additional lock, assuming that the source observable is well-behaved to begin with.

    - Dave


    http://davesexton.com/blog

    • 已标记为答案 borovikpe 2012年5月5日 19:46
    •