An Introduction to the Reactive Extensions Ivan Towlson Mindscape.

Slides:



Advertisements
Similar presentations
The Microsoft Technical Roadshow 2007 Language Enhancements and LINQ Daniel Moth Developer & Platform Group Microsoft Ltd
Advertisements

Language Integrated Query (LINQ) Martin Parry Developer & Platform Group Microsoft Ltd
Unit 1: Overview of the Microsoft.NET Platform
Developing Event Driven State Machine Workflows S1 S2 S3 S4 Adam Calderon Principal Engineer - Interknowlogy Microsoft MVP – C#
.NET 3.5 SP1 New features Enhancements Visual Studio 2008 SP1 New features Enhancements Additional features/enhancements.
Reactive Extension to .NET
Slides license: Creative Commons Attribution Non-Commercial Share Alike See
Achieving with Rx Sean Seanmccarthy.me.
Reactive Extensions (Rx) for Silverlight Tim Greenfield Vertigo Software.
Deep Dive into LINQ Eran Sharabi.NET Development Team Leader JohnBryce Training
How to Not Write a For Loop and other stories Ivan Towlson Mindscape.
1 Reactive Programming with Rx (based on Ras Bodik, Thibaud Hottelier, James Ide UC Berkeley CS164: Introduction.
Het Asynchrone Microsoft Landschap Kees Dijk Senior Software Developer, Vivens
James Kolpack, InRAD LLC popcyclical.com. CodeStock is proudly partnered with: Send instant feedback on this session via Twitter: Send a direct message.
Bing it on, Reactive Extensions Building a quick search app from scratch in WPF with Rx and Bing.com.
Lessons learned from developing a Windows 8 Metro application in C# Frode Nilsen Nilsen Labs Ticki.
Demystifying the .NET Asynchronous Programming Landscape
Dive into linq ivan towlson mindscape. imagine there’s no sql.
Rx Framework Reactive Extensions for.Net and JavaScript Andrea Nasoni & Diego Guidi.
By Brandon Sheppard. Use of Iterator  Sequentially move through a collection  Can be very convenient  Phonebook example: Phone number listings stored.
Windows Presetation Foundation (WPF) 1. Introduction.
Design Patterns. What is a Design Pattern? Generic pattern for solving a certain class of problem Learn to recognize the class of problem and apply a.
What’s new in ASP.NET 3.5? Mike Ormond Developer & Platform Group Microsoft Ltd
Iterator Pattern Dr. Neal CIS 480. Iterator An iterator pattern can be used when one class is a collection of things and would like to provide a standardized.
Object-Oriented Analysis and Design
Curing Your Event Processing Blues with Reactive Extensions (Rx)
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Aptech Borivali(West) Hefin Dsouza. Agenda  What is.NET and What is Visual Studio? .NET Framework 3.5 Overview.  Visual Studio 2008 Enhancements. 
1 Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
READING, WRITING, BINDING, VALIDATING AND VISUALISING YOUR DATA Business value with Silverlight.
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
LINQ, Take Two Realizing the LINQ to Everything Dream Bart J.F. De Smet Senior Software Development Engineer Microsoft Corporation.
Context Tailoring the DBMS –To support particular applications Beyond alphanumerical data Beyond retrieve + process –To support particular hardware New.
Reactive Extensions Ye olde introduction and walk-through, with plenty o’ code.
A Revolutionary Programming Pattern that Will Clean up your Code : Coroutines in C++ David Sackstein ACCU 2015.
An Extensible Test Framework for Microsoft StreamInsight Alex Raizman Asvin Ananthanarayan Anton Kirilov Badrish Chandramouli Mohamed Ali.
Patterns in programming 1. What are patterns? “A design pattern is a general, reusable solution to a commonly occurring problem in software. A design.
Monads Steve Goguen. About Me Web Developer for Allied Building Supply  ASP.NET, SQL Server, LINQ, etc. Website:
Reactive Extensions (Rx) Explained Presenter: Kevin Grossnicklaus August 5 th, 2011.
Object Oriented Software Development 9. Creating Graphical User Interfaces.
Lap Around Visual Studio 2008 &.NET 3.5 Enhancements.
Interfaces 1. Interfaces are (parts of) contracts Interfaces are contracts between implementers and consumers Consumers: Programmers using a class implementing.
LINQ, Take Two Realizing the LINQ to Everything Dream Bart J.F. De Smet blogs.bartdesmet.net/bart
Paul Using Rx; 8 November 2014 Raleigh Code Camp.
1 Lecture 21 Reactive Programming with Rx Duality between Push and Pull models, Iterable vs. Observable. Composing two asynchronous services. Ras Bodik.
Please visit m.ausalgo.com on your device and sign inm.ausalgo.com.
Silverlight 2 Andrew Pardoe Program Manager CLR Execution Engine
1 Lecture 22 Reactive Programming with Rx Duality between Push and Pull models, Iterable vs. Observable. Composing two asynchronous services. Ras Bodik.
Inside LINQ to Objects How LINQ to Objects work Inside LINQ1.
Enterprise Library Caching Application Block Peter Provost Software Design Engineer Ron Jacobs Product Manager Scott Densmore Software Design Engineer.
LINQ Language Integrated Query LINQ1. LINQ: Why and what? Problem Many data sources: Relational databases, XML, in-memory data structures, objects, etc.
Luke Hoban Senior Program Manager Microsoft Session Code: DTL319.
Functional Programming Data Aggregation and Nested Queries Ivan Yonkov Technical Trainer Software University
The cutting edge event for ITPros and Devs December 7-8, 2013 Athens, Greece Fix it once use it everywhere Elias Markelis MCT, Windows Phone Enthusiast.
Enterprise Library 3.0 Memi Lavi Solution Architect Microsoft Consulting Services Guy Burstein Senior Consultant Advantech – Microsoft Division.
RxJava and SWT: Out with Events, in with FRP
DotNetSpider Editor Hefin Dsouza
Java SWING and Model View Controller (MVC)
Data Transport for Online & Offline Processing
Reactive Android Development
Tapping the Power of Your Historical Data
C++ Forever: Interactive Applications in the Age of Manycore
WPF AKEEL AHMED.
Reactive Android Development
Advanced Topics in Concurrency and Reactive Programming: ReactiveX
Language Integrated Query (LINQ)
DEV422 Becoming a C# Time Lord Joe Albahari 2/5/ :46 AM
Server & Tools Business
Presentation transcript:

An Introduction to the Reactive Extensions Ivan Towlson Mindscape

Composable operators for working with sets of data Reintroducing LINQ

IEnumerable: the little interface that could

Extends IEnumerable to support translation of LINQ queries for processing by another engine IQueryable: the little interface that takes twelve years to implement

IEnumerable is a pull model Unpredictable streams are better handled by a push model Pulling and pushing

Introducing IObservable

interface IEnumerable { IEnumerator GetEnumerator(); } interface IObservable { IDisposable Subscribe(IObserver ); }

interface IEnumerator { bool MoveNext(); T Current; } interface IObservable { void OnNext(T); void OnError(Exception); void OnCompleted(); }

An implementation of the LINQ standard query operators (and more) for the IObservable interface Introducing the Reactive Extensions

IEnumerable LINQ to Objects IObservable “LINQ to Events” IQueryable e.g LINQ to SQL Pull (interactive) Push (reactive) Translatable (expression trees) Fixed (MSIL) How? What?

A unified, declarative, composable way of working with asynchronous sources Builds on existing sources of asynchrony, rather than replacing them Introducing the Reactive Extensions

Like LINQ, Rx doesn’t do anything you couldn’t do in your own code, but it wraps up a lot of boilerplate and ad hoc code into convenient, composable operators Introducing the Reactive Extensions

Where does asynchronous data come from?

Events as asynchronous data

Revisiting the asynchronous method pair pattern

Not useful in themselves, but useful for composition Observable.Create: explicitly spelling out the event sequence (like an iterator) Primitive constructors and generators

The pulls push and the pushers pull with apologies to P J Harvey

IEnumerable LINQ to Objects IObservable “LINQ to Events” IQueryable e.g LINQ to SQL Pull (interactive) Push (reactive) Translatable (expression trees) Fixed (MSIL) How? What? ToXxx AsXxx

What can we do with asynchronous data once we’ve got a source?

Where Select / SelectMany Count / Any / All and all the rest LINQ operators

Scan Buffer (with time and count options) TakeUntil Merge / Amb And a whole lot more besides

Sample Throttle / Timeout Timestamp / TimeInterval DistinctUntilChanged And a whole lot more besides

What about timing? What about threading?

IEnumerable LINQ to Objects IObservable “LINQ to Events” IQueryable e.g LINQ to SQL Pull (interactive) Push (reactive) Translatable (expression trees) Fixed (MSIL) How? What? When? IScheduler

Immediate Thread pool, task pool WPF or WinForms UI thread Custom Schedulers

ObserveOn SubscribeOn Or we could just do it right here on the UI thread

Sorry, Visual Basic fans, but the doors are now locked A brief interlude for the obligatory eggheadtude

IEnumerable LINQ to Objects IObservable “LINQ to Events” IQueryable e.g LINQ to SQL Pull (interactive) Push (reactive) Translatable (expression trees) Fixed (MSIL) How? What? dual homoiconic

Orthogonality fail?

IEnumerable LINQ to Objects IObservable “LINQ to Events” IQueryable e.g LINQ to SQL Pull (interactive) Push (reactive) Translatable (expression trees) Fixed (MSIL) How? What? FILL ME

Also known as IQueryableObservable or IShouldntChooseNamesWhileStoned Introducing IQbservable

Allows queries to be translated for processing by external push sources Like IQueryable, filtering, aggregation, etc. can be performed at the source Introducing IQbservable

LINQ to * IEnumerable LINQ to Objects IObservable “LINQ to Events” IQueryable e.g LINQ to SQL Pull (interactive) Push (reactive) Translatable (expression trees) Fixed (MSIL) How? What? IQbservable e.g. LINQ to WMI

.NET, Silverlight: download from MSDN Windows Phone 7: included in ROM but can download updated version JavaScript: download from MSDN Availability

MSDN DevLabs – Projects > Rx PDC talk – FT10, Bart de Smet Rx Design Guidelines document Resources

Thanks! Ivan Towlson |