reactive extensions itjam

23
reactive extensions

Upload: ciklum

Post on 10-May-2015

390 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Reactive extensions itjam

reactive extensions

Page 2: Reactive extensions itjam

about me

Kharkov – Ciklum (Scale Point) - .NET – podcasts – open source

Page 3: Reactive extensions itjam

rx current version• Base interfaces in BCL .NET 4 and

WP7• Stable version: v1.0.10621• Experimental Release: v1.1.10621• Last update: June 29, 2011• http://msdn.microsoft.com/en-us/

data/gg577609

Page 4: Reactive extensions itjam

rx for.NET

.NET 3.5 SP1 .NET 4

Silverlight Silverlight 4 Silverlight 5 Windows Phone

Java script

Page 5: Reactive extensions itjam

rx mission“Rx is a library for composing

asynchronous and event-based programs using observable collections.”

Page 6: Reactive extensions itjam

“asynchronous”

Page 7: Reactive extensions itjam

“observable”interface IEnumerable<out T>{ IEnumerator<T> GetEnumerator();}

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

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

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

Page 8: Reactive extensions itjam

Environment

MoveN

ex

tGot next?

Application

On

Next

Have next!

IEnumerable<T>

IEnumerator<T>

IObservable<T>

IObserver<T>

Inte

racti

ve R

eactiv

e

Page 9: Reactive extensions itjam

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

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

Page 10: Reactive extensions itjam

“composing”• Linq(Where, Take, Skip, Sum, Max,

Any, …)• Statements(If, Case, For, While,

DoWhile)• Combinators(Merge, Zip, Amb, …)• Exceptions(Catch, Retry, ..)• Rx(Delay, Throttle, Interval, Publish,

…)

Page 11: Reactive extensions itjam

“event-based”Observable.FromEventPattern()Observable.FromAsyncEventPattern()

Page 12: Reactive extensions itjam

ISchedulerObservable.OnserveOn()Observable.SubscribeOn(Scheduler.Tas

kPool)

Page 13: Reactive extensions itjam

demo

Page 14: Reactive extensions itjam

rx unit testing

Page 15: Reactive extensions itjam

more rxRx Contrib

http://rxcontrib.codeplex.com/ Reactive Extensions - Extensions (Rxx)

http://rxx.codeplex.com/ Rx Power Toys

http://rxpowertoys.codeplex.com/

Page 16: Reactive extensions itjam

examples

Page 17: Reactive extensions itjam

ReactiveUI

http://www.reactiveui.net/

Page 18: Reactive extensions itjam

domain events

http://chaliy.name/archive/2010/1/business_logic_rx_example

Page 19: Reactive extensions itjam

TweetSharp.Rx

https://github.com/jhollingworth/TweetSharp.Rx

Page 20: Reactive extensions itjam

rx in books

Page 21: Reactive extensions itjam

informationRx team blog

http://blogs.msdn.com/rxteamDevLabs

http://msdn.microsoft.com/en-us/data/gg577609MSDN forums

http://social.msdn.microsoft.com/Forums/en-US/rxChannel9

http://channel9.msdn.com/Tags/RxWiki

http://rxwiki.wikidot.com

Page 22: Reactive extensions itjam

summary

Page 23: Reactive extensions itjam

[email protected]@ciklum.net

@dimapasko