LinqPad Demos

  1. BackgroundThread
  2. ThreadSafe
  3. ColdEnumerable
  4. ColdObservable
  5. HotObservable
  6. Create
  7. CreateDisposable
  8. GenerateWithTime

VisualStudio Demos

Querying a server

  1. A slow or expensive query
  2. On a background loop
  3. With user initiated action, for the impatient
  4. But not too often
  5. Compare the ad-hoc w/ the Rx approach

UI for password check

  1. Accept correct password
  2. Reject incorrect
  3. No “submit button”
  4. Timeout
  5. Must be unit testable

Twitter client

  1. Need to make an IO from a traditional API
  2. Want a mock version for UI development
  3. Only want to show latest for each user
  4. Want late subscribers to have latest values

Streaming Olap

Agenda

What's the Rx thing about, why should I care?

Reactive matters

A good way?

Two use cases

  1. Managing a bar
  2. Calling a web service async

So what is Rx?

A look at some recent Rx questions

Open questions?

More Details - IEnumerable and IEnumerator

 
interface IEnumerable<T>
{   
    IEnumerator<T> GetEnumerator();
}

interface IEnumerator<T>: IDisposable 
{   
    T Current { get; }  
    bool MoveNext();
}

More Details - IObservable and IObserver

 
interface IObservable<T>
{   
    IDisposable Subscribe(IObserver<T> observer);
}

interface IObserver<T>
{   
    void OnCompleted(); 
    void OnError(Exception error);  
    void OnNext(T value);
}

Pop Quiz - Hot or Not?

JessRabbit

Pop Quiz - Hot or Not?

  1. new[] { 1, 2, 3, 4 }
  2. new List<string>()
  3. Enumerable.Range(1, Int32.MaxValue)
  4. new int[Int32.MaxValue]
  5. People.Where(pers => pers.Age >= 21)
  6. Observable.Range(1,3)
  7. Observable.FromEvent("Click")

Traps

How to build

Demos

You must first compile via command line msbuild.

> msbuild .\rx.msbuild

To run the twitter example, you'll need to create the authkeys.txt file and add your own twitter API authkey

Slide deck

slideshow -f http://github.com/geraldb/slideshow-s6-syntax-highlighter/raw/master/s6syntax.txt
slideshow -t s6syntax.txt .\README.md -o Slideshow