Difference between revisions of "NET Reactive Framework"
From JVMLangSummit
Jump to navigationJump to searchm |
|||
Line 34: | Line 34: | ||
} | } | ||
− | interface Observer<T throws E> { | + | // dual to Enumerator, except that Disposable is not dualized: |
+ | interface Observer<T throws E> extends Disposable { | ||
// dual to moveNext returning false: | // dual to moveNext returning false: | ||
void onCompleted(); | void onCompleted(); |
Revision as of 15:05, 17 September 2009
Contents
.NET Reactive Framework
Erik Meijer, Microsoft
- Project
- Blog
- Slides
- File:File.pdf
Abstract
The .NET Reactive Framework — Erik Meijer
The .NET Reactive Framework (Rx) is an abstraction of the well-known Subject/Observer pattern derived as the mathematical dual of the iterator pattern.
We show how Rx can be used to program against event streams and asynchronous computations using LINQ syntax as well as using good old imperative code.
Types
(roughly translated to roughly-Java syntax)
Enumerable
interface Enumerable<T> { Enumerator<T> getEnumerator(); } interface Enumerator<T throws E> extends Disposable { bool moveNext(); T current() throws E; }
Observable
interface Observable<T> { // dual to getEnumerator: Disposable putObserver(Observer<? extends T> o); } // dual to Enumerator, except that Disposable is not dualized: interface Observer<T throws E> extends Disposable { // dual to moveNext returning false: void onCompleted(); // dual to current() returning x: void onNext(T x) ; // dual to current() throwing e: void onError(E e) ; }
Background
Current Status
Future
Key Issues for Discussion
(please expand cooperatively)