Reactive          Extensions for              .NET                Previously Linq to EventsEric R Taylor                  ...
IObserver - Observable• Comparable to IEnumerable and IEnumerator• Built into .Net 4.0, In the System namespace Eric R Tay...
Push vs. Pull• Pull – IEnumerable     o Gather a set of data     o Do something for each item in the set• Push – IObservab...
Linq Extensions• Extension methods based on IEnumerable<T>•     Chainable•     Filtering – Where•     Projection – Select•...
Reactive Extensions• Extension methods based on IObservable<T>•     Chainable•     Filtering – Where•     Projection – Sel...
MergeEric R Taylor           7/10/2012   6
SkipUntil - TakeUntil                green.SkipUntil(blue).TakeUntil(red)Eric R Taylor                                    ...
Buffer           1    2   3   4    5   6   7                1   2    3   4   5   6                2   3    4   5   6   7Er...
Subscriptions• Joining an IObserver to an IObservable• Returns an IDisposable, Dispose to unsubscribe• Extension methods f...
Scheduler• Most extensions that are time based have overrides  that accept a scheduler. Eric R Taylor                     ...
Standard Event                 CompositionEric R Taylor                    7/10/2012   11
Converting Standard   Events into ObservablesEric R Taylor           7/10/2012   12
Rx Event CompositionEric R Taylor            7/10/2012   13
Rx Event ProjectionEric R Taylor                         7/10/2012   14
Rx IObservable ChainingEric R Taylor       7/10/2012   15
Rx Multiple SubscribersEric R Taylor           7/10/2012   16
Rx Multiple SubscribersEric R Taylor           7/10/2012   17
Upcoming SlideShare
Loading in …5
×

Reactive extensions for dot net

567 views

Published on

Reactive extensions for dot net - departmental presentation

Published in: Technology, Sports
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
567
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
9
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide
  • Events as data over time
  • Reactive extensions for dot net

    1. 1. Reactive Extensions for .NET Previously Linq to EventsEric R Taylor 7/10/2012 1
    2. 2. IObserver - Observable• Comparable to IEnumerable and IEnumerator• Built into .Net 4.0, In the System namespace Eric R Taylor 7/10/2012 2
    3. 3. Push vs. Pull• Pull – IEnumerable o Gather a set of data o Do something for each item in the set• Push – IObservable o Decide what you want to do for each item o React to each item as it is introduced Eric R Taylor 7/10/2012 3
    4. 4. Linq Extensions• Extension methods based on IEnumerable<T>• Chainable• Filtering – Where• Projection – Select• Paging – Take, Skip• Composition – Join• Rearrange – OrderBy Eric R Taylor 7/10/2012 4
    5. 5. Reactive Extensions• Extension methods based on IObservable<T>• Chainable• Filtering – Where• Projection – Select• Paging – TakeUntil, SkipUntil• Composition – Merge, Zip, CombineLatest• Time based – Interval, Delay, Throttle, Sample Eric R Taylor 7/10/2012 5
    6. 6. MergeEric R Taylor 7/10/2012 6
    7. 7. SkipUntil - TakeUntil green.SkipUntil(blue).TakeUntil(red)Eric R Taylor 7/10/2012 7
    8. 8. Buffer 1 2 3 4 5 6 7 1 2 3 4 5 6 2 3 4 5 6 7Eric R Taylor 7/10/2012 8
    9. 9. Subscriptions• Joining an IObserver to an IObservable• Returns an IDisposable, Dispose to unsubscribe• Extension methods for Subscribe overrides Eric R Taylor 7/10/2012 9
    10. 10. Scheduler• Most extensions that are time based have overrides that accept a scheduler. Eric R Taylor 7/10/2012 10
    11. 11. Standard Event CompositionEric R Taylor 7/10/2012 11
    12. 12. Converting Standard Events into ObservablesEric R Taylor 7/10/2012 12
    13. 13. Rx Event CompositionEric R Taylor 7/10/2012 13
    14. 14. Rx Event ProjectionEric R Taylor 7/10/2012 14
    15. 15. Rx IObservable ChainingEric R Taylor 7/10/2012 15
    16. 16. Rx Multiple SubscribersEric R Taylor 7/10/2012 16
    17. 17. Rx Multiple SubscribersEric R Taylor 7/10/2012 17

    ×