I am quite new to work with Reactive Extensions, so this might be a newbie question, but i have the following scenario:
I fetch 3 IEnumerable lists (of different types) from the database and populate a view model. I would however like to coordinate the subscriptions to trigger something when all lists have completed loading. Is this possible with Reactive Extensions or am i thinking in the wrong way? Code loks like this:
GetCustomers()
.ToObservable(Scheduler.Default)
.Buffer(20).ObserveOn(SynchronizationContext.Current)
.Subscribe(View.Model.AddRange);
GetCountries()
.ToObservable(Scheduler.Default)
.Buffer(20).ObserveOn(SynchronizationContext.Current)
.Subscribe(View.Model.AddRange);
GetTransports()
.ToObservable(Scheduler.Default)
.Buffer(20).ObserveOn(SynchronizationContext.Current)
.Subscribe(View.Model.AddRange);
You could try using observable joins. Something like this:
It runs in parallel and you get all the results in one at the end.