SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
Dmitri Nesteruk
dmitri@activemesa.com

http://activemesa.com
http://spbalt.net

Based on materials
by Scott Weinstein
Multiple data items can be “processed” in either
a push or a pull fashion.
In a pull paradigm, data is processed at the
leisure of the destination. Common examples
include:
     reading from a file
     summing the numbers in an array
     iterating though a database query
     traversing a directory listing
     paging through an Amazon search
In a push paradigm, data is processed via
demands of the source. Common examples
include:
  Device measurements such as
    time
    light
    heat
  User triggered data such as
    Mouse & Keyboard events
    UI events
    Sales transactions
  Asynchronous code
In .Net Pulled data is exposed via a single core
interface
   IEnumerable/IEnumerator
Pushed data is exposed via
   Events
   Ad-hoc delegate callbacks
   Ad-hoc subscribe/callback interfaces
   BeginXXX/EndXXX Async pattern
   3rd party attempts at Linq for Pushed data
   (Clinq, Slinq, PushLinq)
Each implementation is unique is it’s own way
LINQ provides a composable, and standard
way to do list manipulations

The Reactive Extensions (RX) attempt to
   Provide a common interface for Pushed data
     IObservable/IObserver
   Enable Linq over Pushed data, providing
   composiblity and standard operators
Available for free from   Domains
MS DevLabs                  Events
http://bit.ly/reext         APM
Support for                 Web service calls
  .Net 3.5 SP1              Async workflows
  .Net 4                    Task<T>-based calls
  Silverlight 3           Applications
  JavaScript                Web page d/l
Not part of .Net 4 :(       Async file IO
  Except the interfaces     Streaming OLAP
5 assemblies (including
PFX)                          System.CoreEx
  Feel free to ILmerge
Main features
                              System.Interactive
  Interfaces (IObserver<T>,
  IObservable<T>)             System.Observable
  Observer conversions
  LINQ support                System.Reactive
  WinForms & WPF
  notification support        System.Threading (PFX)
  Infrastructure
No particular namespace
Implemented by the object that wants to
receive notifications
  OnNext(T value)
  Called when a value has been provided
  OnError(Exception ex)
  Called in case of an error
  OnCompleted()
  When done
The contract is
OnNext* (OnError|OnCompleted)
Implemented by an object which can be
observed
IDisposable Subscribe(
  IObserver<T> obs);
Called by the observer to subscribe
Typical behavior
  Adds each observer to a List<IObserver<T>>
  Calls OnXxx() on each listed observer
Dispose() called to unsubscribe
  More composable – no need for Unsubscribe()
Typically, you would not implement these
interfaces
  Use helper methods to get Observable<T>
  Use Subscribe() to act as an Observer<T>
Observable.FromEvent()
Observable.FromAsyncPattern()
EnumerableEx.ToObservable()
  Enumerable → Observable
Observable.Interval
  Generates an event in an interval
Observable.FromXxx lets you create an
anonymous observable
Subscribe() lets you create an anonymous
observer
Parameters take
  An IObserver<T>
  A combination of Action<T>’s that correspond to
  OnNext, OnError and OnCompleted
New LINQ combinators      Amb
  Time                    CombineLatest
  Presence/absence        Delay
  Value changes
                          Repeat
  Value patterns
  Utility                 TakeUntil/TakeWhile
                          SkipUntil/SkipWhile
Mirrored in IEnumerable   Scan
  EnumerableEx            Timer
                          Using
Scan                       CombineLatest
Yields running aggregate   Combines each pair of
values                     latest values

list = { 1, 2, 3 };
o.Scan((a,b) => a+b)

yields

1, 3, 6
Merge                       Zip
Collates two streams into   Pairwise collection of
one                         items in stream
How observables produce values even when
not subscribed
  var timer = new Timer(1000);
  var hot = Observable.FromEvent(
    timer, “Elapsed”);
Cold observable produces values onl y on
subscriptions
  var cold = Obsevable.Interval(
    TimeSpan.FromSeconds(1));
Rx itself http://bit.ly/reext
Rx Team Blog http://blogs.msdn.com/RxTeam/
   Lots of Rx videos
Rx PowerToys
http://rxpowertoys.codeplex.com/
   Tracing
   Time machine scheduler
   Marble diagram generator (.Net 4)
Shameless plug: http://bit.ly/rxrus
Questions?

Mais conteúdo relacionado

Mais procurados

Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to PythonDylan Seychell
 
Repl internals
Repl internalsRepl internals
Repl internalsMongoDB
 
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
Study & Analysis of Complexities of Stack & Queue Operations in Data StructureStudy & Analysis of Complexities of Stack & Queue Operations in Data Structure
Study & Analysis of Complexities of Stack & Queue Operations in Data StructureMeghaj Mallick
 
Apache Flink @ NYC Flink Meetup
Apache Flink @ NYC Flink MeetupApache Flink @ NYC Flink Meetup
Apache Flink @ NYC Flink MeetupStephan Ewen
 
Tutorial - 16 : How to pass parameters from one script to another by CallScri...
Tutorial - 16 : How to pass parameters from one script to another by CallScri...Tutorial - 16 : How to pass parameters from one script to another by CallScri...
Tutorial - 16 : How to pass parameters from one script to another by CallScri...Yogindernath Gupta
 
Correctness and Performance of Apache Spark SQL
Correctness and Performance of Apache Spark SQLCorrectness and Performance of Apache Spark SQL
Correctness and Performance of Apache Spark SQLNicolas Poggi
 
Asynchronous Python at Kumparan
Asynchronous Python at KumparanAsynchronous Python at Kumparan
Asynchronous Python at KumparanBayu Aldi Yansyah
 
Implementation of queue using singly and doubly linked list.
Implementation of queue using singly and doubly linked list.Implementation of queue using singly and doubly linked list.
Implementation of queue using singly and doubly linked list.central university of bihar
 
OctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues aboutOctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues aboutKamil Samigullin
 
The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189Mahmoud Samir Fayed
 
Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJSBrainhub
 
The Singleton Pattern In Java
The Singleton Pattern In JavaThe Singleton Pattern In Java
The Singleton Pattern In JavaKohei Nozaki
 
Reactive programming in PHP
Reactive programming in PHPReactive programming in PHP
Reactive programming in PHPJohney Park
 
Stacks overview with its applications
Stacks overview with its applicationsStacks overview with its applications
Stacks overview with its applicationsSaqib Saeed
 
Project of data structure
Project of data structureProject of data structure
Project of data structureUmme habiba
 
Launching Applications
Launching ApplicationsLaunching Applications
Launching Applicationsprimeteacher32
 

Mais procurados (20)

Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Repl internals
Repl internalsRepl internals
Repl internals
 
Stack Data structure
Stack Data structureStack Data structure
Stack Data structure
 
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
Study & Analysis of Complexities of Stack & Queue Operations in Data StructureStudy & Analysis of Complexities of Stack & Queue Operations in Data Structure
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
 
Apache Flink @ NYC Flink Meetup
Apache Flink @ NYC Flink MeetupApache Flink @ NYC Flink Meetup
Apache Flink @ NYC Flink Meetup
 
Tutorial - 16 : How to pass parameters from one script to another by CallScri...
Tutorial - 16 : How to pass parameters from one script to another by CallScri...Tutorial - 16 : How to pass parameters from one script to another by CallScri...
Tutorial - 16 : How to pass parameters from one script to another by CallScri...
 
Correctness and Performance of Apache Spark SQL
Correctness and Performance of Apache Spark SQLCorrectness and Performance of Apache Spark SQL
Correctness and Performance of Apache Spark SQL
 
Asynchronous Python at Kumparan
Asynchronous Python at KumparanAsynchronous Python at Kumparan
Asynchronous Python at Kumparan
 
Implementation of queue using singly and doubly linked list.
Implementation of queue using singly and doubly linked list.Implementation of queue using singly and doubly linked list.
Implementation of queue using singly and doubly linked list.
 
Reactive Java (GeeCON 2014)
Reactive Java (GeeCON 2014)Reactive Java (GeeCON 2014)
Reactive Java (GeeCON 2014)
 
OctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues aboutOctoLab Cookbook: how to use composer.yml and stop creating issues about
OctoLab Cookbook: how to use composer.yml and stop creating issues about
 
The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.6 book - Part 8 of 189
 
Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJS
 
AMC Minor Technical Issues
AMC Minor Technical IssuesAMC Minor Technical Issues
AMC Minor Technical Issues
 
The Singleton Pattern In Java
The Singleton Pattern In JavaThe Singleton Pattern In Java
The Singleton Pattern In Java
 
Reactive programming in PHP
Reactive programming in PHPReactive programming in PHP
Reactive programming in PHP
 
Data Structure (Stack)
Data Structure (Stack)Data Structure (Stack)
Data Structure (Stack)
 
Stacks overview with its applications
Stacks overview with its applicationsStacks overview with its applications
Stacks overview with its applications
 
Project of data structure
Project of data structureProject of data structure
Project of data structure
 
Launching Applications
Launching ApplicationsLaunching Applications
Launching Applications
 

Destaque

Функциональное программирование для разработки распределённых, облачных и веб...
Функциональное программирование для разработки распределённых, облачных и веб...Функциональное программирование для разработки распределённых, облачных и веб...
Функциональное программирование для разработки распределённых, облачных и веб...Dmitri Soshnikov
 
Машинное обучение на платформе .NET - DotNext 2016 Piter
Машинное обучение на платформе .NET - DotNext 2016 PiterМашинное обучение на платформе .NET - DotNext 2016 Piter
Машинное обучение на платформе .NET - DotNext 2016 PiterRoman Nevolin
 
SECR2013: F# и обработка потоковых данных: от потока твиттер-сообщений до сен...
SECR2013: F# и обработка потоковых данных: от потока твиттер-сообщений до сен...SECR2013: F# и обработка потоковых данных: от потока твиттер-сообщений до сен...
SECR2013: F# и обработка потоковых данных: от потока твиттер-сообщений до сен...Dmitri Soshnikov
 
Увлекательный мир программирования.
Увлекательный мир программирования.Увлекательный мир программирования.
Увлекательный мир программирования.Dmitri Soshnikov
 
Машинное обучение для школьников
Машинное обучение для школьниковМашинное обучение для школьников
Машинное обучение для школьниковDmitri Soshnikov
 
reactive dotNet
reactive dotNetreactive dotNet
reactive dotNet0xffAA
 
Design Patterns in Modern C++
Design Patterns in Modern C++Design Patterns in Modern C++
Design Patterns in Modern C++Dmitri Nesteruk
 
Data mining в реальном проекте
Data mining в реальном проектеData mining в реальном проекте
Data mining в реальном проектеAlexander Byndyu
 
CallSharp: Automatic Input/Output Matching in .NET
CallSharp: Automatic Input/Output Matching in .NETCallSharp: Automatic Input/Output Matching in .NET
CallSharp: Automatic Input/Output Matching in .NETDmitri Nesteruk
 
Баг-трекер по-новому: что и почему JetBrains изменил в последней версии YouTrack
Баг-трекер по-новому: что и почему JetBrains изменил в последней версии YouTrackБаг-трекер по-новому: что и почему JetBrains изменил в последней версии YouTrack
Баг-трекер по-новому: что и почему JetBrains изменил в последней версии YouTrackAlexander Byndyu
 
Большие возможности для маленькой компании
Большие возможности для маленькой компанииБольшие возможности для маленькой компании
Большие возможности для маленькой компанииAlexander Byndyu
 
Шаблоны интеграции - актуальные инструменты и решения
Шаблоны интеграции - актуальные инструменты и решенияШаблоны интеграции - актуальные инструменты и решения
Шаблоны интеграции - актуальные инструменты и решенияAlexander Byndyu
 
Кнопочное мышление против целостного IT-продукта
Кнопочное мышление против целостного IT-продуктаКнопочное мышление против целостного IT-продукта
Кнопочное мышление против целостного IT-продуктаAlexander Byndyu
 
Impact Mapping на практике v2
Impact Mapping на практике v2Impact Mapping на практике v2
Impact Mapping на практике v2Alexander Byndyu
 
Машинное обучение на платформе .NET
Машинное обучение на платформе .NETМашинное обучение на платформе .NET
Машинное обучение на платформе .NETRoman Nevolin
 
Теория и практика .NET-бенчмаркинга (25.01.2017, Москва)
 Теория и практика .NET-бенчмаркинга (25.01.2017, Москва) Теория и практика .NET-бенчмаркинга (25.01.2017, Москва)
Теория и практика .NET-бенчмаркинга (25.01.2017, Москва)Andrey Akinshin
 
Поговорим про арифметику
Поговорим про арифметикуПоговорим про арифметику
Поговорим про арифметикуAndrey Akinshin
 

Destaque (19)

Tpl DataFlow
Tpl DataFlowTpl DataFlow
Tpl DataFlow
 
Функциональное программирование для разработки распределённых, облачных и веб...
Функциональное программирование для разработки распределённых, облачных и веб...Функциональное программирование для разработки распределённых, облачных и веб...
Функциональное программирование для разработки распределённых, облачных и веб...
 
Машинное обучение на платформе .NET - DotNext 2016 Piter
Машинное обучение на платформе .NET - DotNext 2016 PiterМашинное обучение на платформе .NET - DotNext 2016 Piter
Машинное обучение на платформе .NET - DotNext 2016 Piter
 
SECR2013: F# и обработка потоковых данных: от потока твиттер-сообщений до сен...
SECR2013: F# и обработка потоковых данных: от потока твиттер-сообщений до сен...SECR2013: F# и обработка потоковых данных: от потока твиттер-сообщений до сен...
SECR2013: F# и обработка потоковых данных: от потока твиттер-сообщений до сен...
 
Увлекательный мир программирования.
Увлекательный мир программирования.Увлекательный мир программирования.
Увлекательный мир программирования.
 
Машинное обучение для школьников
Машинное обучение для школьниковМашинное обучение для школьников
Машинное обучение для школьников
 
reactive dotNet
reactive dotNetreactive dotNet
reactive dotNet
 
Design Patterns in Modern C++
Design Patterns in Modern C++Design Patterns in Modern C++
Design Patterns in Modern C++
 
Data mining в реальном проекте
Data mining в реальном проектеData mining в реальном проекте
Data mining в реальном проекте
 
CallSharp: Automatic Input/Output Matching in .NET
CallSharp: Automatic Input/Output Matching in .NETCallSharp: Automatic Input/Output Matching in .NET
CallSharp: Automatic Input/Output Matching in .NET
 
Баг-трекер по-новому: что и почему JetBrains изменил в последней версии YouTrack
Баг-трекер по-новому: что и почему JetBrains изменил в последней версии YouTrackБаг-трекер по-новому: что и почему JetBrains изменил в последней версии YouTrack
Баг-трекер по-новому: что и почему JetBrains изменил в последней версии YouTrack
 
Большие возможности для маленькой компании
Большие возможности для маленькой компанииБольшие возможности для маленькой компании
Большие возможности для маленькой компании
 
Час Кода 2015
Час Кода 2015Час Кода 2015
Час Кода 2015
 
Шаблоны интеграции - актуальные инструменты и решения
Шаблоны интеграции - актуальные инструменты и решенияШаблоны интеграции - актуальные инструменты и решения
Шаблоны интеграции - актуальные инструменты и решения
 
Кнопочное мышление против целостного IT-продукта
Кнопочное мышление против целостного IT-продуктаКнопочное мышление против целостного IT-продукта
Кнопочное мышление против целостного IT-продукта
 
Impact Mapping на практике v2
Impact Mapping на практике v2Impact Mapping на практике v2
Impact Mapping на практике v2
 
Машинное обучение на платформе .NET
Машинное обучение на платформе .NETМашинное обучение на платформе .NET
Машинное обучение на платформе .NET
 
Теория и практика .NET-бенчмаркинга (25.01.2017, Москва)
 Теория и практика .NET-бенчмаркинга (25.01.2017, Москва) Теория и практика .NET-бенчмаркинга (25.01.2017, Москва)
Теория и практика .NET-бенчмаркинга (25.01.2017, Москва)
 
Поговорим про арифметику
Поговорим про арифметикуПоговорим про арифметику
Поговорим про арифметику
 

Semelhante a Reactive Extensions

Parallel Processing
Parallel ProcessingParallel Processing
Parallel ProcessingRTigger
 
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan EwenAdvanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewenconfluent
 
Reactive Extensions: classic Observer in .NET
Reactive Extensions: classic Observer in .NETReactive Extensions: classic Observer in .NET
Reactive Extensions: classic Observer in .NETEPAM
 
TechWiseTV Workshop: Catalyst Switching Programmability
TechWiseTV Workshop: Catalyst Switching ProgrammabilityTechWiseTV Workshop: Catalyst Switching Programmability
TechWiseTV Workshop: Catalyst Switching ProgrammabilityRobb Boyd
 
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016 A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016 Databricks
 
Akka.NET streams and reactive streams
Akka.NET streams and reactive streamsAkka.NET streams and reactive streams
Akka.NET streams and reactive streamsBartosz Sypytkowski
 
Introduction to Actionscript3
Introduction to Actionscript3Introduction to Actionscript3
Introduction to Actionscript3Yoss Cohen
 
A Deep Dive into Structured Streaming in Apache Spark
A Deep Dive into Structured Streaming in Apache Spark A Deep Dive into Structured Streaming in Apache Spark
A Deep Dive into Structured Streaming in Apache Spark Anyscale
 
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)Sylvain Hallé
 
Logging, tracing and metrics: Instrumentation in .NET 5 and Azure
Logging, tracing and metrics: Instrumentation in .NET 5 and AzureLogging, tracing and metrics: Instrumentation in .NET 5 and Azure
Logging, tracing and metrics: Instrumentation in .NET 5 and AzureAlex Thissen
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container EraSadayuki Furuhashi
 
DevSecCon Singapore 2018 - System call auditing made effective with machine l...
DevSecCon Singapore 2018 - System call auditing made effective with machine l...DevSecCon Singapore 2018 - System call auditing made effective with machine l...
DevSecCon Singapore 2018 - System call auditing made effective with machine l...DevSecCon
 
Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2JollyRogers5
 
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...InfluxData
 
Dc 12 Chiueh
Dc 12 ChiuehDc 12 Chiueh
Dc 12 Chiuehwollard
 
Reactive programming with RxAndroid
Reactive programming with RxAndroidReactive programming with RxAndroid
Reactive programming with RxAndroidSavvycom Savvycom
 

Semelhante a Reactive Extensions (20)

Parallel Processing
Parallel ProcessingParallel Processing
Parallel Processing
 
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan EwenAdvanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
 
Reactive Extensions: classic Observer in .NET
Reactive Extensions: classic Observer in .NETReactive Extensions: classic Observer in .NET
Reactive Extensions: classic Observer in .NET
 
TechWiseTV Workshop: Catalyst Switching Programmability
TechWiseTV Workshop: Catalyst Switching ProgrammabilityTechWiseTV Workshop: Catalyst Switching Programmability
TechWiseTV Workshop: Catalyst Switching Programmability
 
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016 A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
 
Akka.NET streams and reactive streams
Akka.NET streams and reactive streamsAkka.NET streams and reactive streams
Akka.NET streams and reactive streams
 
Introduction to Actionscript3
Introduction to Actionscript3Introduction to Actionscript3
Introduction to Actionscript3
 
A Deep Dive into Structured Streaming in Apache Spark
A Deep Dive into Structured Streaming in Apache Spark A Deep Dive into Structured Streaming in Apache Spark
A Deep Dive into Structured Streaming in Apache Spark
 
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
A "Do-It-Yourself" Specification Language with BeepBeep 3 (Talk @ Dagstuhl 2017)
 
Logging, tracing and metrics: Instrumentation in .NET 5 and Azure
Logging, tracing and metrics: Instrumentation in .NET 5 and AzureLogging, tracing and metrics: Instrumentation in .NET 5 and Azure
Logging, tracing and metrics: Instrumentation in .NET 5 and Azure
 
Logging for Production Systems in The Container Era
Logging for Production Systems in The Container EraLogging for Production Systems in The Container Era
Logging for Production Systems in The Container Era
 
Stream Processing with Ballerina
Stream Processing with BallerinaStream Processing with Ballerina
Stream Processing with Ballerina
 
DevSecCon Singapore 2018 - System call auditing made effective with machine l...
DevSecCon Singapore 2018 - System call auditing made effective with machine l...DevSecCon Singapore 2018 - System call auditing made effective with machine l...
DevSecCon Singapore 2018 - System call auditing made effective with machine l...
 
Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2
 
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
Lessons Learned: Running InfluxDB Cloud and Other Cloud Services at Scale | T...
 
Async Programming in C# 5
Async Programming in C# 5Async Programming in C# 5
Async Programming in C# 5
 
Dc 12 Chiueh
Dc 12 ChiuehDc 12 Chiueh
Dc 12 Chiueh
 
Reactive programming with RxAndroid
Reactive programming with RxAndroidReactive programming with RxAndroid
Reactive programming with RxAndroid
 
Rxandroid
RxandroidRxandroid
Rxandroid
 
RxAndroid
RxAndroidRxAndroid
RxAndroid
 

Mais de Dmitri Nesteruk

Mais de Dmitri Nesteruk (20)

Good Ideas in Programming Languages
Good Ideas in Programming LanguagesGood Ideas in Programming Languages
Good Ideas in Programming Languages
 
Design Pattern Observations
Design Pattern ObservationsDesign Pattern Observations
Design Pattern Observations
 
C# Tricks
C# TricksC# Tricks
C# Tricks
 
Introduction to Programming Bots
Introduction to Programming BotsIntroduction to Programming Bots
Introduction to Programming Bots
 
Converting Managed Languages to C++
Converting Managed Languages to C++Converting Managed Languages to C++
Converting Managed Languages to C++
 
Monte Carlo C++
Monte Carlo C++Monte Carlo C++
Monte Carlo C++
 
YouTrack: Not Just an Issue Tracker
YouTrack: Not Just an Issue TrackerYouTrack: Not Just an Issue Tracker
YouTrack: Not Just an Issue Tracker
 
Проект X2C
Проект X2CПроект X2C
Проект X2C
 
Domain Transformations
Domain TransformationsDomain Transformations
Domain Transformations
 
Victor CG Erofeev - Metro UI
Victor CG Erofeev - Metro UIVictor CG Erofeev - Metro UI
Victor CG Erofeev - Metro UI
 
Developer Efficiency
Developer EfficiencyDeveloper Efficiency
Developer Efficiency
 
Distributed Development
Distributed DevelopmentDistributed Development
Distributed Development
 
Dynamics CRM Data Integration
Dynamics CRM Data IntegrationDynamics CRM Data Integration
Dynamics CRM Data Integration
 
ReSharper Presentation for NUGs
ReSharper Presentation for NUGsReSharper Presentation for NUGs
ReSharper Presentation for NUGs
 
ReSharper Architecture & Extensions
ReSharper Architecture & ExtensionsReSharper Architecture & Extensions
ReSharper Architecture & Extensions
 
Web mining
Web miningWeb mining
Web mining
 
Data mapping tutorial
Data mapping tutorialData mapping tutorial
Data mapping tutorial
 
Design Patterns in .Net
Design Patterns in .NetDesign Patterns in .Net
Design Patterns in .Net
 
Metaprogramming
MetaprogrammingMetaprogramming
Metaprogramming
 
Code Generation
Code GenerationCode Generation
Code Generation
 

Último

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Reactive Extensions

  • 2. Multiple data items can be “processed” in either a push or a pull fashion. In a pull paradigm, data is processed at the leisure of the destination. Common examples include: reading from a file summing the numbers in an array iterating though a database query traversing a directory listing paging through an Amazon search
  • 3. In a push paradigm, data is processed via demands of the source. Common examples include: Device measurements such as time light heat User triggered data such as Mouse & Keyboard events UI events Sales transactions Asynchronous code
  • 4. In .Net Pulled data is exposed via a single core interface IEnumerable/IEnumerator Pushed data is exposed via Events Ad-hoc delegate callbacks Ad-hoc subscribe/callback interfaces BeginXXX/EndXXX Async pattern 3rd party attempts at Linq for Pushed data (Clinq, Slinq, PushLinq) Each implementation is unique is it’s own way
  • 5. LINQ provides a composable, and standard way to do list manipulations The Reactive Extensions (RX) attempt to Provide a common interface for Pushed data IObservable/IObserver Enable Linq over Pushed data, providing composiblity and standard operators
  • 6. Available for free from Domains MS DevLabs Events http://bit.ly/reext APM Support for Web service calls .Net 3.5 SP1 Async workflows .Net 4 Task<T>-based calls Silverlight 3 Applications JavaScript Web page d/l Not part of .Net 4 :( Async file IO Except the interfaces Streaming OLAP
  • 7. 5 assemblies (including PFX) System.CoreEx Feel free to ILmerge Main features System.Interactive Interfaces (IObserver<T>, IObservable<T>) System.Observable Observer conversions LINQ support System.Reactive WinForms & WPF notification support System.Threading (PFX) Infrastructure No particular namespace
  • 8. Implemented by the object that wants to receive notifications OnNext(T value) Called when a value has been provided OnError(Exception ex) Called in case of an error OnCompleted() When done The contract is OnNext* (OnError|OnCompleted)
  • 9. Implemented by an object which can be observed IDisposable Subscribe( IObserver<T> obs); Called by the observer to subscribe Typical behavior Adds each observer to a List<IObserver<T>> Calls OnXxx() on each listed observer Dispose() called to unsubscribe More composable – no need for Unsubscribe()
  • 10. Typically, you would not implement these interfaces Use helper methods to get Observable<T> Use Subscribe() to act as an Observer<T> Observable.FromEvent() Observable.FromAsyncPattern() EnumerableEx.ToObservable() Enumerable → Observable Observable.Interval Generates an event in an interval
  • 11. Observable.FromXxx lets you create an anonymous observable Subscribe() lets you create an anonymous observer Parameters take An IObserver<T> A combination of Action<T>’s that correspond to OnNext, OnError and OnCompleted
  • 12.
  • 13. New LINQ combinators Amb Time CombineLatest Presence/absence Delay Value changes Repeat Value patterns Utility TakeUntil/TakeWhile SkipUntil/SkipWhile Mirrored in IEnumerable Scan EnumerableEx Timer Using
  • 14. Scan CombineLatest Yields running aggregate Combines each pair of values latest values list = { 1, 2, 3 }; o.Scan((a,b) => a+b) yields 1, 3, 6
  • 15. Merge Zip Collates two streams into Pairwise collection of one items in stream
  • 16.
  • 17. How observables produce values even when not subscribed var timer = new Timer(1000); var hot = Observable.FromEvent( timer, “Elapsed”); Cold observable produces values onl y on subscriptions var cold = Obsevable.Interval( TimeSpan.FromSeconds(1));
  • 18. Rx itself http://bit.ly/reext Rx Team Blog http://blogs.msdn.com/RxTeam/ Lots of Rx videos Rx PowerToys http://rxpowertoys.codeplex.com/ Tracing Time machine scheduler Marble diagram generator (.Net 4) Shameless plug: http://bit.ly/rxrus