Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Wes Dyer and Jeffrey Van Gogh: Rx Virtual Time

44 minutes, 21 seconds


Right click “Save as…”

The latest release of Rx includes new tools for testing reactive programs as well as virtual scheduling. In this video, Jeffrey and Wes discuss virtual time and virtual schedulers and how they can be used to write tests and query historical data.

What is virtual time, exactly? What purpose does it serve and how is it related to reality? Wait a century-second. What time is it? When?

As usual, Wes and Jeff go deep. Dive in with us. This is heady stuff and also really useful for practical programming with Rx. It's always great to spend some time with Wes and Jeff at the whiteboard and at the computer (they demo this for us towards the end of the session).



Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
  • ChevalN2Cheval Why not null?

    Just like any other co-ordinate system can the virtual time convert to decimal, binary time or 13 month year time system? Covariance and contra-variance over time; nice. Where to plug-in the landmarks? At the extension points?

  • FlatlinerFlatliner With our thoughts we make the world.

    Awesome, finally understand how Scheduler.Now is used, when I first saw that in Rx I knew you guys were using (or planning on using) virtual time but there seemed to be no documentation anywhere on the subject. Thanks for the explanation guys, extremely useful. Eagerly waiting on your unit tests so that I can start writing my asynchronous unit tests like that!

    I just realised I can write unit tests that simulate "hot" observables that I don't normally have control over i.e. mouse moves  etc, I can replace the original source with a mock observable that raises events a pre-determined times and pushes them through a virtual scheduler. Excellent!

  • I was hoping for a tutorial or video on the scheduling aspects of Rx because they remained a mystery for me, so thanks. Please do release the test code!

  • Bent Rasmussenexoteric stuck in a loop, for a while

    Thanks for sharing! I've still not spent the time with Rx I've been meaning to. :-/

  • @N2Cheval,


    you would create a scheduler that derives from VirtualScheduler, give it two type parameters that implement the absolute and relative part of your notion of time. For this to work, your notion of time will need to be able to :

    • Convert your notion of absolute time to DateTimeOffset
    • Convert TimeSpan to your notion of relative time
    • Increment your notion of absolute time with your notion of relative time to produce a new instance of your notion of absolute time.

  • http://blogs.msdn.com/b/jeffva/archive/2010/08/27/testing-rx.aspx contains sample code, that hopefully will give you a headstart. We're  working on getting our tests shipping as well, but will take a bit more time..



  • getting "Do you want to download this file" prompt (IE) when clicking "Play" to watch the video...



    nevermind - working now.

  • Great stuff, thanks a lot.

Remove this comment

Remove this thread


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.