All values are queued and delivered using the scheduler from the supplied coordination.
More...
All values are queued and delivered using the scheduler from the supplied coordination.
- Template Parameters
-
Coordination | the type of the scheduler. |
- Parameters
-
cn | the scheduler to notify observers on. |
- Returns
- The source observable modified so that its observers are notified on the specified scheduler.
- Sample Code\n
printf("[thread %s] Start task\n", get_pid().c_str());
printf("[thread %s] Emit value %d\n", get_pid().c_str(), v);
return v;
});
values.
[](int v){printf("[thread %s] OnNext: %d\n", get_pid().c_str(), v);},
[](){printf("[thread %s] OnCompleted\n", get_pid().c_str());});
printf("[thread %s] Finish task\n", get_pid().c_str());
[thread 139846724265792] Start task
[thread 139846724265792] Emit value 1
[thread 139846724265792] Emit value 2
[thread 139846724265792] Emit value 3
[thread 139846467180288] OnNext: 1
[thread 139846467180288] OnNext: 2
[thread 139846467180288] OnNext: 3
[thread 139846467180288] OnCompleted
[thread 139846724265792] Finish task
Invoking rxcpp::observable::subscribe_on operator, instead of observe_on, gives following results: [thread 139846724265792] Start task
[thread 139845879985920] Emit value 1
[thread 139845879985920] OnNext: 1
[thread 139845879985920] Emit value 2
[thread 139845879985920] OnNext: 2
[thread 139845879985920] Emit value 3
[thread 139845879985920] OnNext: 3
[thread 139845879985920] OnCompleted
[thread 139846724265792] Finish task