Closed zhang-z closed 3 weeks ago
The SubscribeOnMainThread
is an operator that adjusts when to subscribe to the Observable
(register the Observer to the Observable).
Therefore, once the subscribe process is complete and the message is ready to be received, the operator has no further significance, and the operator does not perform any operation in the order in which the messages are issued.
I'm new to R3/Rx.NET. Thinking of refactoring my Unity game in this design pattern:
SubscribeOnMainThread
method to respond to certain data change events and modify the Unity game objects.Is
Subscribe**OnMainThread**
necessary? Am I using R3 in the correct way? Thanks.Another question for
SubscribeOnMainThread
, what if an Observable event happens twice between two frames. What is gonna happen in the MainThread? Handler code executed twice in sequence?