Video and slides synchronized, mp3 and slide download available at URL http://bit.ly/1NAoRFg.
Bart de Smet discusses how the reactive programming paradigm fits the requirements of rich querying capabilities for event streams and can be applied from small devices all the way to cloud-scale infrastructures. Filmed at qconnewyork.com.
Bart de Smet is a Principal Software Development Engineer working on large scale stream processing systems in the Applications and Services Division at Microsoft, a course and book author. In his current role at Microsoft, he’s overseeing the architecture, design, and implementation of event processing systems that run at massive scale in data centers, as well as on cloud-connected devices.
2. InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/reactive-cloud-scale
3. Presented at QCon New York
www.qconnewyork.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
4.
5.
Tesla
mid 2000s
LINQ to Events
Nikola Tesla
www.knowledgeoftoday.org
7.
Events are not first-class objects
[RunOnClient]
public event EventHandler<MouseEventArgs> MouseMoved;
// Runs in cloud
public void CloudCanvas()
{
MouseMoved += (o, e) => { /* do stuff */ };
}
An electric eel…
8.
delegates
Action a = new Action(Foo); // explicit creation of delegate instance
Action b = Foo; // method group conversion
Action c = () => { … }; // creates anonymous method
void Foo() { … }
event Action Bar // metadata that refers to …
{
add { … } // add accessor
remove { … } // remove accessor
}
http://en.wikipedia.org/wiki/First-class_citizen
14.
Await Stephen Kleene
Kleene star (closure)
www.Wikipedia.org
Func<T> f
var x = wait f();
IEnumerable<T> xs
foreach (var x in xs) {
f(x);
}
Task<T> t
var x = await t;
IObservable<T> xs
xs.Subscribe(x => {
f(x);
});
OneMany
Synchronous Asynchronous
15.
Code-as-data
Alan Kay
Homoiconicity, 1969
www.Wikipedia.org
IEnumerable<T> xs
from x in xs where f(x) …
IQueryable<T> xs
from x in xs where f(x) …
IObservable<T> xs
from x in xs where f(x) …
IQbservable<T> xs
from x in xs where f(x) …
CodeData
Pull Push
26.
Proxies
Definitions
Metadata
Hyper-cube
Synchronous versus asynchronous
Extrinsic versus intrinsic identities
Code-as-data versus code
Reliable versus non-reliable
Etc.
Higher dimensions
Calabi-Yau manifold
www.Wikipedia.org
Async
Extrinsic
E.g. this is the
client-side API
Need string theory
27. context
proxies
var conn = new ReactiveServiceConnection(endpoint);
var ctx = new ClientContext(conn);
var traffic = ctx.GetObservable<TrafficInfo>(trafficUri);
var http = ctx.GetObserver<HttpData>(httpUri);
Explicit identifiers
provided for artifacts
28.
extrinsic identifiers
Async
var traffic = ctx.GetObservable<TrafficInfo>(trafficUri);
var http = ctx.GetObserver<HttpData>(httpUri);
var subscription = await traffic.Where(t => t.Road == “I-90”)
.Select(t => new HttpData { Uri = myService,
Body = t.ToString() })
.SubscribeAsync(http, mySubUri);
Explicit identifiers
provided for artifacts
32.
parameterized observables
var xs = ctx.GetObservable<int>(xsUri);
var iv = ctx.GetObserver<int>(ivUri);
await xs.Where(x => x > 0).Select(x => x * x).SubscribeAsync(iv, …);
var xs = ctx.GetObservable<int>(xsUri);
var iv = ctx.GetObserver<int>(ivUri);
var where = ctx.GetObservable<IARQ<int>, Expr<Func<int, bool>>, int>(whereUri);
var select = ctx.GetObservable<IARQ<int>, Expr<Func<int, int>>, int>(selectUri);
await select(where(xs, x => x > 0), x => x * x).SubscribeAsync(iv, …);
33. [KnownResource] attributes can be used everywhere
Provide shorthand syntax for Get* operations
Enable code generation using the Metadata facilities
What’s IAsyncReactiveQbservable<T>?
Async because it’s client-side (cf. SubscribeAsync)
Reactive because we had to disambiguate with Rx concepts
Qbservable because it’s expression tree based
static class AsyncReactiveQbservable
{
[KnownResource(whereUri)]
static IAsyncReactiveQbservable<T> Where<T>(this IAsyncReactiveQbservable<T> xs,
Expression<Func<T, bool>> filter) {…}
}