Rx Dev Videos

Reactive Extensions API in depth: CombineLatest

Download this episode

Download Video

Description

In this episode of the Rx API in depth, Wes talks about the CombineLatest operator and it's relation to the Zip operator

Visit the Reactive Extensions DevLabs page to download and learn more about Rx.

Embed

Format

Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • staceyw

      Thank you.  Could you please add Senerios for usage in the videos?  It can help understand why one would use an operator.

    • J.Van.Gogh

      Definately, we already have the videos for the upcoming week or so recorded, but we'll include that in the next batch we'll record..

       

      CombineLatest is extremely useful in a scenario where you always need a pair of events e.g. you need to know the latest key pressed in combination of the latest position of the mouse cursor.

    • exoteric

      Then also amp up the volume please, it's very very low; I thought this was a passing issue while Charles was at the PDC. Going from this to a RiSE video you hear the extremely loud logo music pumping out in the speakers (pretty late here).

       

      Still, good series you have here. It's kind of an interesting concept. One video per method, you can almost make video-intellisense with that. It would be cool to have these marble diagrams in the MSDN documentation.

    • J.Van.Gogh

      Yup aware of the volume (and lighting) issues, recording on a Flip right now, which is great for home videos but less ideal for these kind of videos, getting a more professional camera soon...

       

      Thanks! Yes we'll definately bring the marble diagrams up with the doc team...

    • aL_

      combine latest is really great if you have streams that operate at diffrent speeds or if you want to aggregate streams Smiley

       

      maybe you have a stock ticker with currency conversion that keeps track of the exchangerates in real time, your app gets told when a stock changes and also when the exchange rate changes, so when either of those events occur you want to change the value the user sees. but maybe the market fluctuates alot but the exchange rate is stable, then zip would produce values that have already become obsolete, but combineLatest would not Smiley

       

      another example is like if you have a robot with sensors that measure vertical and horizontal position, and you have code that keeps the robot from falling over, neither sensor is aware of the other and they produce values independently. Yet if one of them changes, the x/y position of the robot has changed and the code needs to be made aware so it can compensate.

       

      zip is similar but a little diffrent. maybe you have a speed dating website where people register and you have one stream for men and one for women and when a new person registers, you want to remember who the last person of the opposite sex who registered was but also make sure that that person is not on a date already and you also make sure that no one who registers is left without a date if one is available. thats what zip will do for you Smiley

    • Thierry

      Is slight hesitation at 1:05 revealing a wrong naming convention ?

       

      Perhaps CombineLatest should be renamed ZipLatest.

    • exoteric

      Maybe a little video post-processing filter will do the trick.

       

      Looking forward to the "pi" combinators.

    • Zahir Tezcan

      Is there any option to be as fast as the slowest stream for streams with different frequencies?

      eg.

       

      for streams

       

      ---x---y---z---t---u--->

      -a-b-c-d-e-f-g-h-i-j-->

      ---o---o---o--o---o-->

      f(a,x)

      f(c,y)

      f(e,z)

      f(g,t)

      f(i,u)

       

      which is to invoke combination when both streams has a 'new' output. This may incur new problems such that observers may want to infer intermediate values for grouping like interpolations.

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.