Slides license: Creative Commons Attribution Non-Commercial Share Alike See

Slides:



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

Reactive Extension to .NET
Creative Commons: A very quick introduction 10/12/ Mic Porter.
1 Reactive Programming with Rx (based on Ras Bodik, Thibaud Hottelier, James Ide UC Berkeley CS164: Introduction.
LINQ and Collections An introduction to LINQ and Collections.
An Introduction to the Reactive Extensions Ivan Towlson Mindscape.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics C# Language &.NET Platform 12 th -13 th Lecture Pavel Ježek.
Programming Languages and Paradigms
Parallel Extensions to the.NET Framework Daniel Moth Microsoft
Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
C# and LINQ Yuan Yu Microsoft Research Silicon Valley.
Bing it on, Reactive Extensions Building a quick search app from scratch in WPF with Rx and Bing.com.
ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
Threads in C# Threads in C#.
Rx Framework Reactive Extensions for.Net and JavaScript Andrea Nasoni & Diego Guidi.
Type System, March 12, Data Types and Behavioral Types Yuhong Xiong Edward A. Lee Department of Electrical Engineering and Computer Sciences University.
Esterel Overview Roberto Passerone ee249 discussion section.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
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.
Curing Your Event Processing Blues with Reactive Extensions (Rx)
LINQ Programming in C# LINQ CSE Prof. Roger Crawfis.
 George Chrysanthakopoulos Software Architect Microsoft Corporation.
From Scenic to SystemC Mehrdad Abutalebi. Outline Introducing Scenic Scenic Implementation Modeling Reactivity A Simple example From Scenic to SystemC.
LINQ, An IntroLINQ, An Intro Florin−Tudor Cristea, Microsoft Student Partner.
LINQ, Take Two Realizing the LINQ to Everything Dream Bart J.F. De Smet Senior Software Development Engineer Microsoft Corporation.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Advanced.NET Programming I 11 th Lecture Pavel Ježek
Reactive Extensions Ye olde introduction and walk-through, with plenty o’ code.
Putting together a complete system Chapter 10. Overview  Design a modest but complete system  A collection of objects work together to solve a problem.
Advanced C#, part IV Niels Hallenberg IT University of Copenhagen (With thanks to Peter Sestoft and Kasper Østerbye) BAAAP – Spring 2009.
Monads Steve Goguen. About Me Web Developer for Allied Building Supply  ASP.NET, SQL Server, LINQ, etc. Website:
Introduction to LINQ Lecture # 19 August Introduction How do you interrogate/manipulate data? What if you could do the work in a type-safe," string-free.
Reactive Extensions (Rx) Explained Presenter: Kevin Grossnicklaus August 5 th, 2011.
LINQ, Take Two Realizing the LINQ to Everything Dream Bart J.F. De Smet blogs.bartdesmet.net/bart
CS 346 – Chapter 4 Threads –How they differ from processes –Definition, purpose Threads of the same process share: code, data, open files –Types –Support.
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.
Electronic Payment Systems (1)
1 Lecture 22 Reactive Programming with Rx Duality between Push and Pull models, Iterable vs. Observable. Composing two asynchronous services. Ras Bodik.
Chapter 3 Collections. Objectives  Define the concepts and terminology related to collections  Explore the basic structures of the Java Collections.
Module 8 Enhancing User Interface Responsiveness.
Parallel Pattern Library Resource Manager Task Scheduler Task Parallel Library Task Parallel Library Parallel LINQ Managed Native Key: Threads Operating.
CS3773 Software Engineering Lecture 06 UML State Machines.
Inside LINQ to Objects How LINQ to Objects work Inside LINQ1.
Implementation of Join Semantics in Java G Stewart von Itzstein University of South Australia.
Linq Overview Vincent GERMAIN. Evolution - Rappel Langage  C# 2.0  C# 3.0 (Local type inference, Lambda expression, Method extension,Anonymous type)
Thread A thread represents an independent module of an application that can be concurrently execution With other modules of the application. MULTITHREADING.
CS533 - Concepts of Operating Systems 1 Threads, Events, and Reactive Objects - Alan West.
IAP C# 2011 Lecture 2: Delegates, Lambdas, LINQ Geza Kovacs.
Design Patterns: Behavioral Design Patterns General and reusable solutions to common problems in software design Software University
Parallel Tools Platform Parallel Debugger Greg Watson Project Leader Greg Watson Project Leader.
LINQ and Lambda Expressions Telerik Software Academy LINQ Overview.
Week 10, Day 3 Review for the quarter SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
Functional Processing of Collections (Advanced) 6.0.
Functional Programming Data Aggregation and Nested Queries Ivan Yonkov Technical Trainer Software University
Concurrency 2 CS 2110 – Spring 2016.
Advanced .NET Programming I 2nd Lecture
Reactive Android Development
Functional Programming
Advanced Topics in Concurrency and Reactive Programming: The Observable Contract Majeed Kassis.
Testing and Debugging.
Iterators and Comparators
Functional Processing of Collections (Advanced)
Advanced Topics in Concurrency and Reactive Programming: ReactiveX
Creative Commons Attribution Non-Commercial Share Alike License
DEV422 Becoming a C# Time Lord Joe Albahari 2/5/ :46 AM
LINQ - 2 Ravi Kumar C++/C# Team.
Server & Tools Business
Advanced .NET Programming I 6th Lecture
CS4540 Special Topics in Web Development LINQ to Objects
Presentation transcript:

Slides license: Creative Commons Attribution Non-Commercial Share Alike See

Rx is a library for composing asynchronous and event-based programs using observable collections. Queries? LINQ? Too hard today…

You could get stuck C# 4.0 covariance

You could get stuck C# 4.0 covariance (Waiting to move next) moving on

Source:

Reversing arrows… Input becomes output and vice versa Making a U-turn in synchrony

C# didn’t borrow Java checked exceptions

IDisposable ( & ) IEnumerator GetEnumerator( void ); We really got an enumerator and a disposable

void IEnumerator IEnumerableDual IEnumerable ) GetEnumerator( Set Will only dualize the synchrony aspect

This is an output too

Discrete domain with true and false

If you got true, you really got a T T

If you got false, you really got void void

(T | void | Exception) MoveNext( void But C# doesn’t have discriminated unions… Let’s splat this into three methods instead! But C# doesn’t have discriminated unions… Let’s splat this into three methods instead! Got IEnumeratorDual IEnumerator IEnumeratorDual>); IEnumerator x);

Source:

Used to detach the observer… Do you really know C# 4.0?

(*) Visit

You could get flooded C# 4.0 contravariance

Environment MoveNext Got next? Application OnNext Have next! IEnumerable IEnumerator IObservable IObserver Interactive Reactive

OnCompleted OnNext OnError new int[0] new[] { 42 } Throwing iterator Iterator that got stuck Notion of time

OnNext(0) OnNext(1) OnNext(2) yield 0 yield 1 yield 2

Hypothetical anonymous iterator syntax in C# Synchronous Asynchronous A variant with time notion exists (GenerateWithTime)

C# doesn’t have anonymous interface implementation, so we provide various extension methods that take lambdas. C# 4.0 named parameter syntax

F10F10

F10F10

F5F5

Breakpoint got hit

Lack of composition Resource maintenance?

Can define operators Resource maintenance!

Lack of composition Exceptions?Exceptions? Synchronous completion? Cancel?Cancel? State?State?

React TextChanged Asynchronous request Reaction Reactive Reactor Data binding on UI thread

input.SelectMany(term => lookup(term))

input Service call 1 Service call 2 UI data binding |R|Re|Rea|Reac|React| Reacti| Reactiv| Reactive| Reactive Reaction Reactive Reactor Source:

input Service call 1 Service call 2 UI data binding |R|Re|Rea|Reac|React| Reacti| Reactiv| Reactive| Reactive Take Until

// Alternative approach for composition using: // IObservable Switch (IObservable > sources) var res = (from term in input select lookup(term)).Switch(); Very local fix Hops from source to source

IEnumerable E.g. LINQ to Objects IObservable E.g. LINQ to Events IQueryable E.g. LINQ to SQL Fixed (MSIL) Translatable (Expression trees) ToQueryable ToObservable ToEnumerable AsQueryable AsEnumerable AsQbservable AsObservable Pull (interactive) Push (reactive) Concurrency (IScheduler) LINQ to *.* What? Where? How? Worker pools Message loops Threads Distributed Duality Homo-iconic IQbservable E.g. LINQ to PowerShell ToQbservable

Rx is a library for composing asynchronous and event-based programs using observable collections. Queries! LINQ! Way simpler with Rx