Your SlideShare is downloading. ×
Reactive Extensions for .NET
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Reactive Extensions for .NET

701

Published on

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

  • Be the first to like this

No Downloads
Views
Total Views
701
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Reactive Extensions for .NET Andrei Marukovich contact@lunarfrog.com twitter: @amarukovich
  • 2. Rx is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators. Rx = Observables + LINQ + Schedulers
  • 3. Observables • IObservable<T> • IObserver<T>
  • 4. Enumerables interface IEnumerable<out T> { IEnumerator<T> GetEnumerator(); } interface IEnumerator<out T> : IDisposable { T Current { get; } bool MoveNext(); void Reset(); }
  • 5. Pull and Push Consumer Pull Any new data? IEnumerable • • • • Sensors UI events Web services Social media Source IObservable Push New data available!
  • 6. Observables interface IObservable<out T> { IDisposable Subscribe(IObserver<T> observer); } interface IObserver<out T> { void OnNext(T value); void OnError(Exception error); void OnCompleted(); }
  • 7. Using observables IObservable IObserver Subscribe OnNext OnNext OnComplete
  • 8. Contract OnNext* [OnComplete | OnError] 1 2 1 3 2 1 2 1 2 3 4 3 3 4 4 5 6
  • 9. Demo: Observable sequences • Subject<T> • Observable • Never, Empty, Return, Throw, Create • Range, Generate, Repeat • Interval, Timer
  • 10. LINQ Filtering • Where, Distinct, Skip(While|Last|Until), Take Inspection • Any, All Aggregation and transformation • Count, Min, Max, Average, Select
  • 11. Demo: LINQ • Common LINQ operators • Combining sequences • Pairing • Sequentially • Concurrently
  • 12. Rx bridges • Observable.FromAsync() • Observable.FromEvent() • Observable.FromEventPattern()
  • 13. Demo: LINQ to events • Time shifting • Throttle • Sample • Buffer • Delay
  • 14. Concurrency SubscribeOn • Invocation of the subscription ObserveOn • Observing of notifications
  • 15. Demo: Concurrency • Schedulers
  • 16. Schedulers • ImmediateScheduler • CurrentThreadScheduler • DispatcherScheduler • EventLoopScheduler • NewThreadScheduler • Thread/Task Pool • TestScheduler
  • 17. Flavors of Rx .NET • WinForms, WPF, Silverlight • Windows Phone, WinRT • ASP .NET Beyond .NET • RxJS, RxCpp • RxPy, Rx.rb
  • 18. Resources • http://rx.codeplex.com/ • http://bit.ly/Rx-Home
  • 19. Thank you! Andrei Marukovich contact@lunarfrog.com twitter: @amarukovich

×