+ All Categories
Home > Software > I have a stream - Insights in Reactive Programming @ geecon Prague 2015

I have a stream - Insights in Reactive Programming @ geecon Prague 2015

Date post: 15-Feb-2017
Category:
Upload: jan-carsten-lohmueller
View: 448 times
Download: 0 times
Share this document with a friend
20
I HAVE A STREAM INSIGHTS IN REACTIVE PROGRAMMING Jan Carsten Lohmüller @nachkonvention Jan Carsten Lohmüller, 22 nd October 2015
Transcript
Page 1: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

I HAVE A STREAMINSIGHTS IN REACTIVE PROGRAMMING

Jan Carsten Lohmüller@nachkonvention

Jan Carsten Lohmüller, 22nd October 2015

Page 2: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

PROCEDURAL

Page 3: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

OBJECT-ORIENTED

Page 4: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

FUNCTIONAL

Page 5: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

REACTIVE

Page 6: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

{ 1, 2, 3, 4, 5, 6 } x=100 x=234 x=234 x=144 x=305 x=226 y=1 y=634 y=137 y=680 y=32 y=227

Page 7: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

Filter(λ => λ.x > 200)

Page 8: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

What's the difference between an array and events?

— Erik Meijer

Page 9: I have a stream - Insights in Reactive Programming @ geecon Prague 2015
Page 10: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

private const string connectionString = @"Data Source=.\SQLSERVER;"+@"Initial Catalog=AdventureWorksLT2008;Integrated Security=SSPI;"private static IObservable<string> GetProducts(){

return Observable.Create<string>(o =>{

using(var conn = new SqlConnection(connectionString))using (var cmd = new SqlCommand("Select Name FROM SalesLT.ProductModel", conn)){

conn.Open();SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);while (reader.Read()){

o.OnNext(reader.GetString(0));}o.OnCompleted();return Disposable.Create(()=>Console.WriteLine("--Disposed--"));

}});

Page 11: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

public void SimpleHotSample(){

var period = TimeSpan.FromSeconds(1);var observable = Observable.Interval(period).Publish();observable.Subscribe(i => Console.WriteLine("first subscription : {0}", i));Thread.Sleep(period);observable.Subscribe(i => Console.WriteLine("second subscription : {0}", i));Console.ReadKey();/* Output: first subscription : 0 first subscription : 1 second subscription : 1 first subscription : 2 second subscription : 2 first subscription : 3 second subscription : 3 */

}

Page 12: I have a stream - Insights in Reactive Programming @ geecon Prague 2015
Page 13: I have a stream - Insights in Reactive Programming @ geecon Prague 2015
Page 14: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

RESPONSIVE

Page 15: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

RESILIENT

Page 16: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

ELASTIC

Page 17: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

MESSAGE-DRIVEN

Page 18: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

http://reactivex.io/languages.html

JavaJavaScriptC#C#(Unity)ScalaClojure

C++Ruby Python Groovy JRuby Kotlin Swift 

Page 19: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

http://reactivex.io/tutorials.html

2 minute introduction to Rx by André Staltz

A Playful Introduction to Rx a video lecture by Erik Meijer

Page 20: I have a stream - Insights in Reactive Programming @ geecon Prague 2015

Recommended