SlideShare a Scribd company logo
1 of 15
AN INTRODUCTION TO
REACTIVE EXTENSIONS
(RX.NET)
ABOUT ME
Bart Kuipers
Freelance Mobile Developer
Xamarin & Flutter.
• CEO @ Baku-Apps
• Senior Mobile Developer @ Minibrew
• Restaurant ordering startup
• DevOps project @ Xablu
AGENDA
1. Why use Reactive Extensions (Rx)?
2. What are Reactive Extensions
3. Demo Time!
4. Advantages & Disadvantages of Rx
5. Question Time!
WHY USE RX?
User Input
(taps, typing)
Social
Media
Messaging
Internet of
Things (IoT)
GPS
Real-time
Stock Prices
WHAT ARE REACTIVE EXTENSIONS (RX)
Event Streams
Observabl
e
Observer
LINQ to Events
• Select
• Where
• First
• FirstOrDefault
• Last
• LastOrDefault
• GroupBy
• Sum
• Skip
• Take
• Count
• Single
• TakeUntill
• Buffer
• DistinctUntilChange
d
• Sampel
• Delay
• Retry
• Timeout
• Many more…..
Select
Timeline of
Observable
Values
emitted by
Observable
Ensucessfully
d of data,
Completed
Result of the
transformatio
n
A specific
transformatio
n
Emits last value within a certain
timespan
Emits unique value lang
BUT WHY NOT USE TASKS?
• Not lazy
• Not restartable
• Can become very complex when
introducing time
• Single value
WHY NOT USE C# EVENTS!
SUPER DUPER AWESOME FUN WITH
FLAGS DEMO APP!
1. Delay search request after each keystroke for 0.5 seconds.
2. Handle delayed search requests. Discard previous search
request and only show latest results.
3. Only search request after search term > 1 characters.
4. Only perform search request until search term is changed
5. Have a 30 seconds timeout for the server response.
TASK & EVENTS VS RX
ADVANTAGES DISADVATAGES
• More expressive and readable code
• Handle streams of data, and pass that
handle around
• A lot of operators that simplify work
• Complex threading becomes easy
• Basically same workings and
operators in different language
(RxJava, RxJS, RxSwift, RxKotlin, etc)
• Steep learning curve
• Can be difficult to debug
• Small performance hit
QUESTION TIME!

More Related Content

What's hot

CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National Police
CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National PoliceCodeMotion Amsterdam 2018 - Microservices in action at the Dutch National Police
CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National PoliceBert Jan Schrijver
 
52ºNorth WPS Use Cases - Benjamin Proß
52ºNorth WPS Use Cases - Benjamin Proß52ºNorth WPS Use Cases - Benjamin Proß
52ºNorth WPS Use Cases - Benjamin ProßLuis_de_Sousa
 
NetflixOSS and ZeroToDocker Talk
NetflixOSS and ZeroToDocker TalkNetflixOSS and ZeroToDocker Talk
NetflixOSS and ZeroToDocker Talkaspyker
 
Internet of Things
Internet of ThingsInternet of Things
Internet of ThingsDeZyre
 
Shallow Dive in to Serverless Architecture
Shallow Dive in to Serverless ArchitectureShallow Dive in to Serverless Architecture
Shallow Dive in to Serverless ArchitectureNateFonseka
 
Automation for the Modern Enterprise - 18 October 2017
Automation for the Modern Enterprise - 18 October 2017Automation for the Modern Enterprise - 18 October 2017
Automation for the Modern Enterprise - 18 October 2017Claire Priester Papas
 
Canary Releases on Kubernetes w/ Spinnaker, Istio, and Prometheus
Canary Releases on Kubernetes w/ Spinnaker, Istio, and PrometheusCanary Releases on Kubernetes w/ Spinnaker, Istio, and Prometheus
Canary Releases on Kubernetes w/ Spinnaker, Istio, and PrometheusKublr
 
CS80A Foothill College Open Source Talk
CS80A Foothill College Open Source TalkCS80A Foothill College Open Source Talk
CS80A Foothill College Open Source Talkaspyker
 
AWS Loft Talk: Behind the Scenes with SignalFx
AWS Loft Talk: Behind the Scenes with SignalFxAWS Loft Talk: Behind the Scenes with SignalFx
AWS Loft Talk: Behind the Scenes with SignalFxSignalFx
 
Stas Kolenkin & Taras Bobalo - CloudFlare Recon Workshop
Stas Kolenkin & Taras Bobalo - CloudFlare Recon WorkshopStas Kolenkin & Taras Bobalo - CloudFlare Recon Workshop
Stas Kolenkin & Taras Bobalo - CloudFlare Recon WorkshopNoNameCon
 
Netflix Cloud Platform and Open Source
Netflix Cloud Platform and Open SourceNetflix Cloud Platform and Open Source
Netflix Cloud Platform and Open Sourceaspyker
 
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...Bert Jan Schrijver
 
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)Martin Spier
 
Ibm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalIbm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalaspyker
 
Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015aspyker
 

What's hot (16)

CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National Police
CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National PoliceCodeMotion Amsterdam 2018 - Microservices in action at the Dutch National Police
CodeMotion Amsterdam 2018 - Microservices in action at the Dutch National Police
 
52ºNorth WPS Use Cases - Benjamin Proß
52ºNorth WPS Use Cases - Benjamin Proß52ºNorth WPS Use Cases - Benjamin Proß
52ºNorth WPS Use Cases - Benjamin Proß
 
NetflixOSS and ZeroToDocker Talk
NetflixOSS and ZeroToDocker TalkNetflixOSS and ZeroToDocker Talk
NetflixOSS and ZeroToDocker Talk
 
Internet of Things
Internet of ThingsInternet of Things
Internet of Things
 
Shallow Dive in to Serverless Architecture
Shallow Dive in to Serverless ArchitectureShallow Dive in to Serverless Architecture
Shallow Dive in to Serverless Architecture
 
Automation for the Modern Enterprise - 18 October 2017
Automation for the Modern Enterprise - 18 October 2017Automation for the Modern Enterprise - 18 October 2017
Automation for the Modern Enterprise - 18 October 2017
 
Canary Releases on Kubernetes w/ Spinnaker, Istio, and Prometheus
Canary Releases on Kubernetes w/ Spinnaker, Istio, and PrometheusCanary Releases on Kubernetes w/ Spinnaker, Istio, and Prometheus
Canary Releases on Kubernetes w/ Spinnaker, Istio, and Prometheus
 
CS80A Foothill College Open Source Talk
CS80A Foothill College Open Source TalkCS80A Foothill College Open Source Talk
CS80A Foothill College Open Source Talk
 
AWS Loft Talk: Behind the Scenes with SignalFx
AWS Loft Talk: Behind the Scenes with SignalFxAWS Loft Talk: Behind the Scenes with SignalFx
AWS Loft Talk: Behind the Scenes with SignalFx
 
Stas Kolenkin & Taras Bobalo - CloudFlare Recon Workshop
Stas Kolenkin & Taras Bobalo - CloudFlare Recon WorkshopStas Kolenkin & Taras Bobalo - CloudFlare Recon Workshop
Stas Kolenkin & Taras Bobalo - CloudFlare Recon Workshop
 
Netflix Cloud Platform and Open Source
Netflix Cloud Platform and Open SourceNetflix Cloud Platform and Open Source
Netflix Cloud Platform and Open Source
 
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
 
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
 
GW Tester
GW TesterGW Tester
GW Tester
 
Ibm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalIbm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinal
 
Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015
 

Similar to An Introduction to Reactive Extensions

Quick look in Reactive Extensions
Quick look in Reactive ExtensionsQuick look in Reactive Extensions
Quick look in Reactive Extensionsjohnlvidal
 
Performance Testing Java Applications
Performance Testing Java ApplicationsPerformance Testing Java Applications
Performance Testing Java ApplicationsC4Media
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaKasun Indrasiri
 
Apache Hadoop YARN State of the Union
Apache Hadoop YARN State of the UnionApache Hadoop YARN State of the Union
Apache Hadoop YARN State of the UnionWeiwei Yang
 
CommCon 2018 - Realtime Machine Learning
CommCon 2018 - Realtime Machine LearningCommCon 2018 - Realtime Machine Learning
CommCon 2018 - Realtime Machine LearningEvan McGee
 
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...Spark Summit
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive uiPaul van Zyl
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsRonny López
 
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native Companion
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native CompanionJakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native Companion
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native CompanionJakarta_EE
 
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Sunghyouk Bae
 
Testing API's: Tools & Tips & Tricks (Oh My!)
Testing API's: Tools & Tips & Tricks (Oh My!)Testing API's: Tools & Tips & Tricks (Oh My!)
Testing API's: Tools & Tips & Tricks (Oh My!)Ford Prior
 
JavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National PoliceJavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National PoliceBert Jan Schrijver
 
Microservices in action at the Dutch National Police
Microservices in action at the Dutch National PoliceMicroservices in action at the Dutch National Police
Microservices in action at the Dutch National PoliceBert Jan Schrijver
 
OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...Bert Jan Schrijver
 
DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith  DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith Docker, Inc.
 
#NEOTYSPAC performance testing shift left
#NEOTYSPAC performance testing shift left#NEOTYSPAC performance testing shift left
#NEOTYSPAC performance testing shift leftAmir Rozenberg
 
Ginsbourg.com presentation of open source performance validation
Ginsbourg.com presentation of open source performance validationGinsbourg.com presentation of open source performance validation
Ginsbourg.com presentation of open source performance validationPerfecto Mobile
 
Introduction to Realm Mobile Platform
Introduction to Realm Mobile PlatformIntroduction to Realm Mobile Platform
Introduction to Realm Mobile PlatformChristian Melchior
 

Similar to An Introduction to Reactive Extensions (20)

Quick look in Reactive Extensions
Quick look in Reactive ExtensionsQuick look in Reactive Extensions
Quick look in Reactive Extensions
 
Performance Testing Java Applications
Performance Testing Java ApplicationsPerformance Testing Java Applications
Performance Testing Java Applications
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-Java
 
Burp Suite Extensions
Burp Suite ExtensionsBurp Suite Extensions
Burp Suite Extensions
 
Apache Hadoop YARN State of the Union
Apache Hadoop YARN State of the UnionApache Hadoop YARN State of the Union
Apache Hadoop YARN State of the Union
 
CommCon 2018 - Realtime Machine Learning
CommCon 2018 - Realtime Machine LearningCommCon 2018 - Realtime Machine Learning
CommCon 2018 - Realtime Machine Learning
 
Mini training - Reactive Extensions (Rx)
Mini training - Reactive Extensions (Rx)Mini training - Reactive Extensions (Rx)
Mini training - Reactive Extensions (Rx)
 
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
Unified Framework for Real Time, Near Real Time and Offline Analysis of Video...
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP Applications
 
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native Companion
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native CompanionJakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native Companion
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native Companion
 
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
 
Testing API's: Tools & Tips & Tricks (Oh My!)
Testing API's: Tools & Tips & Tricks (Oh My!)Testing API's: Tools & Tips & Tricks (Oh My!)
Testing API's: Tools & Tips & Tricks (Oh My!)
 
JavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National PoliceJavaZone 2017 - Microservices in action at the Dutch National Police
JavaZone 2017 - Microservices in action at the Dutch National Police
 
Microservices in action at the Dutch National Police
Microservices in action at the Dutch National PoliceMicroservices in action at the Dutch National Police
Microservices in action at the Dutch National Police
 
OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...OpenValue meetup October 2017 - Microservices in action at the Dutch National...
OpenValue meetup October 2017 - Microservices in action at the Dutch National...
 
DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith  DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith
 
#NEOTYSPAC performance testing shift left
#NEOTYSPAC performance testing shift left#NEOTYSPAC performance testing shift left
#NEOTYSPAC performance testing shift left
 
Ginsbourg.com presentation of open source performance validation
Ginsbourg.com presentation of open source performance validationGinsbourg.com presentation of open source performance validation
Ginsbourg.com presentation of open source performance validation
 
Introduction to Realm Mobile Platform
Introduction to Realm Mobile PlatformIntroduction to Realm Mobile Platform
Introduction to Realm Mobile Platform
 

Recently uploaded

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
#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
 

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
#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
 

An Introduction to Reactive Extensions

  • 1. AN INTRODUCTION TO REACTIVE EXTENSIONS (RX.NET)
  • 2. ABOUT ME Bart Kuipers Freelance Mobile Developer Xamarin & Flutter. • CEO @ Baku-Apps • Senior Mobile Developer @ Minibrew • Restaurant ordering startup • DevOps project @ Xablu
  • 3. AGENDA 1. Why use Reactive Extensions (Rx)? 2. What are Reactive Extensions 3. Demo Time! 4. Advantages & Disadvantages of Rx 5. Question Time!
  • 4. WHY USE RX? User Input (taps, typing) Social Media Messaging Internet of Things (IoT) GPS Real-time Stock Prices
  • 5. WHAT ARE REACTIVE EXTENSIONS (RX) Event Streams Observabl e Observer LINQ to Events • Select • Where • First • FirstOrDefault • Last • LastOrDefault • GroupBy • Sum • Skip • Take • Count • Single • TakeUntill • Buffer • DistinctUntilChange d • Sampel • Delay • Retry • Timeout • Many more…..
  • 6. Select Timeline of Observable Values emitted by Observable Ensucessfully d of data, Completed Result of the transformatio n A specific transformatio n
  • 7. Emits last value within a certain timespan
  • 9. BUT WHY NOT USE TASKS? • Not lazy • Not restartable • Can become very complex when introducing time • Single value
  • 10. WHY NOT USE C# EVENTS!
  • 11.
  • 12. SUPER DUPER AWESOME FUN WITH FLAGS DEMO APP! 1. Delay search request after each keystroke for 0.5 seconds. 2. Handle delayed search requests. Discard previous search request and only show latest results. 3. Only search request after search term > 1 characters. 4. Only perform search request until search term is changed 5. Have a 30 seconds timeout for the server response.
  • 13. TASK & EVENTS VS RX
  • 14. ADVANTAGES DISADVATAGES • More expressive and readable code • Handle streams of data, and pass that handle around • A lot of operators that simplify work • Complex threading becomes easy • Basically same workings and operators in different language (RxJava, RxJS, RxSwift, RxKotlin, etc) • Steep learning curve • Can be difficult to debug • Small performance hit

Editor's Notes

  1. This talk is a very gentle introduction to Reactive Extensions (RX.NET). And to give you an overview of Reactive extensions and why you should care. Because the world today is reactive. Why should we care -> Data is being received by event streams and less by actively asking for data. Data is coming at you and you have to react to that data. Examples are: stock tickers, messengers and social media and GPS, and other sensors on the phone (step counter).
  2. History: Father of RX is Eric Meijer (a Dutch computer scientist/researcher working for Microsoft) Rx manifesto Push & Pull models (IEnumerable vs Observable & IEnumerator vs Observer) RX released in 2009 Talk about Observer pattern. We have an Observable which sends a stream of data and we have an observer which subscribes to the Observable This can all be concurrent asynchronous code!!! Show Marbles (Select/map & Throtteling & DistinctUntil)
  3. Observer patterns: Producer/Sender/Observable -----> Consumer/Listener/Observer (we will be using Observables and Observers) Task are great but: not lazy -> they run right away you declare them. Not restartable -> if you await a task again you get the exact same value Writing asynchronous code with Tasks can become very complex as we will see later in the quick demo. Why RX RX are the opposite -> they are Lazy (only fire when listened to/observed) and they are restartable. If you listen to a RX again -> it will give you fresh data (maybe the same but fresh). RX allows as small and readable code (more expressive as they would say) Testable -> same piece of code run concurrently in production and synchronously in unit test Also RX is an almost uniform language you can use for many different languages… and will have almost similar operations and how it works
  4. Start using events can cause problems. Should be unsubscribed (main source of memory leaks). Islands or events methods, difficult to reason about the flow of the program. If I want to change some logic before the event (e.g. filter) we have to change the event method. We cannot “easily” edit it. Events are not “first-class citizens”… meaning I cannot just take the event and send it to an argument of another method. Timeout when not response in 30 sec
  5. Observable are a push model, meaning we don’t have all the values currently. This introduces another dimension, the time dimension. There are many time operators, and as we saw in the demo pretty easy to use. Rx is compatible with asynchronous programming tasks, async/await. It is possible to very easily convert a Task to an Observable using the ToObservable extension method or use Observable.FromAsync(). We can await an Observable. However it will only return the last value of the stream. So in the demo of the case I explained for Akavache it will get only the last send notification/value before the stream is completed.