Reactive Vert.x
-
Upload
david-dossot -
Category
Technology
-
view
1.315 -
download
2
description
Transcript of Reactive Vert.x
REACTIVE
Event-Driven
Message passingEvent bus
Non-blocking IO
Scalable
Distributed event-busLocation transparency
Clustered in-memory cache
Resilient
Module and verticle isolationWorker processes
Automatic HA failover
Responsive
“Don't block the event loop!”Time-outs
Event-bus “back pressure”
JavaRubyScala
ClojurePythonGroovy
JavaScript...
PHP
Polyglot Friction
Andrew Cholakianhttp://blog.andrewvc.com/vertx-node-on-ropes
Why ?
https://rx.codeplex.com/
https://github.com/Netflix/RxJava
https://github.com/vert-x/mod-rxvertx
Callback HelleventBus.<JsonObject> sendWithTimeout(metricsAddress, METERS_BUS_REQUEST, 1000L, ar1 -> {
JsonObject metersData = ar1.succeeded() ? ar1.result().body() : new JsonObject();
eventBus.<JsonObject> sendWithTimeout(metricsAddress, HISTOGRAMS_BUS_REQUEST, 1000L, ar2 -> {
JsonObject histogramData = ar2.succeeded() ? ar2.result().body() : new JsonObject();
processData(metersData.mergeIn(histogramData)); });});
Callback HelpObservable<JsonObject> observeMeters = eventBus.<JsonObject, JsonObject> send(metricsAddress, METERS_BUS_REQUEST) .map(msg -> msg.body()) .timeout(1L, SECONDS, from(new JsonObject()));
Observable<JsonObject> observeHistograms = eventBus.<JsonObject, JsonObject> send(metricsAddress, HISTOGRAMS_BUS_REQUEST) .map(msg -> msg.body()) .timeout(1L, SECONDS, from(new JsonObject()));
zip(observeMeters, observeHistograms, (jo1, jo2) -> jo1.mergeIn(jo2)) .subscribe(data -> processData(data));
http://careers.unbounce.com
@ddossot