Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think, if you are receiving a list of entities from each REST call, your call should have a little different signature - you are not observing each value in the return collection, you are observing the event of the call completion. So for airports, it should have the signature:</p> <pre><code>public IObservable&lt;Aiports&gt; GetAirports() </code></pre> <p>The next step would be to run first three in parallel and wait on all of them:</p> <pre><code>var ports_lines_statuses = Observable.ForkJoin(GetAirports(), GetAirlines(), GetStatuses()); </code></pre> <p>The third step woul be to compose the above abservable with the GetFlights():</p> <pre><code>var decoratedFlights = from pls in ports_lines_statuses let airport = MyAirportFunc(pls) from flight in GetFlights(airport) select flight; </code></pre> <p>EDIT: I still do not understand why your services return </p> <pre><code>IObservable&lt;Airport&gt; </code></pre> <p>instead of </p> <pre><code>IObservable&lt;IEnumerable&lt;Airport&gt;&gt; </code></pre> <p>AFAIK, from the REST call you get all entities at once - but maybe you do paging? Anyway, if you want RX do the buffering you could use .BufferWithCount() :</p> <pre><code> var allAirports = new AirportNamesService() .GetAirports().BufferWithCount(int.MaxValue); ... </code></pre> <p>Then you can apply ForkJoin:</p> <pre><code>var ports_lines_statuses = allAirports .ForkJoin(allAirlines, PortsLinesSelector) .ForkJoin(statuses, ... </code></pre> <p>ports_lines_statuses would contain a single event on the timeline which would contain all the reference data.</p> <p>EDIT: Here's another one, using the freshly minted ListObservable (latest release only):</p> <pre><code>allAiports = airports.Start(); allAirlines = airlines.Start(); allStatuses = statuses.Start(); ... whenReferenceDataLoaded = Observable.Join(airports.WhenCompleted() .And(airlines.WhenCompleted()) .And(statuses.WhenCompleted()) Then((p, l, s) =&gt; new Unit())); public static IObservable&lt;Unit&gt; WhenCompleted&lt;T&gt;(this IObservable&lt;T&gt; source) { return source .Materialize() .Where(n =&gt; n.Kind == NotificationKind.OnCompleted) .Select(_ =&gt; new Unit()); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload