SlideShare uma empresa Scribd logo
1 de 35
Globalcode – Open4education
Node.js – Reactive Programming with Observables
and RxJS
Felipe Rohde
Globalcode – Open4education
Agenda
Application goals
Async JS
Promises vs. Observables
Data model - Streams
Basic usage
Observables
Creation from scratch
Quick recap
RxJS to the rescue
What is this
Creation helpers
Operators
“hot" vs. “cold"
Use case - Resilient web socket
Globalcode – Open4education
Application goals
Keep responsive all the times - React on load
Unacceptable halt while processing
Resilient - React on fail - Self recover
Reactive
Impossible to predict when process will be done
Advantage of Async
Globalcode – Open4education
Async JS
Levels of async computations
Time and latency become key issues
Simple applications “callback" is enough
But to scale … hard to maintain, hard to test
Async computation is hard to manage
Globalcode – Open4education
Callback Hell
makeHttpCall('/items',
items => {
for (itemId of items) {
makeHttpCall(`/items/${itemId}/info`,
itemInfo => {
makeHttpCall(`/items/${itemInfo.pic}`,
img => {
showImg(img);
});
});
}
});
Globalcode – Open4education
Async JS
Callbacks (Callback Hell)
Promises (ES6 Spec)
Generators
Async / Await
Observables (ES7 Spec)
Globalcode – Open4education
Promises vs. Observables
Both are built to solve async problems
(to avoid callback hell)
The idea of future values
Eventual results
Code scalability
Globalcode – Open4education
Promises vs. Observables
Fluent interface with notion of time and exposes the
method continually
Read-only view to a single future value
Success and fail semantics via .then() and .catch()
Not lazy, once started, it is on the way to being
resolved
Not cancellable, it will resolve or reject, only once
Globalcode – Open4education
Promises vs. Observables
makeHttpCall('/items')
.then(itemId => makeHttpCall(`/items/${itemId}/info`))
.then(itemInfo => makeHttpCall(`/items/${itemInfo}.pic}`))
.then(showImg);
Globalcode – Open4education
Promises vs. Observables
“Streams” or collections
Any amount of data
Any amount of time
Lazy, by default. Just produce values when there
are subscribers
Can be cancelled, stop producing values
Objects that can inform other objects of the
changes they publish
Globalcode – Open4education
Promises vs. Observables
Single return value Multiple return values
Pull / Sync / Interactive Object
Iterables
(Array, Set, Map, Object)
Push / Async / Reactive Promise Observable
“Observables, returns 0 - ∞ values between now
and the end of time”
Globalcode – Open4education
Data Model - Streams
Nothing more than a sequence of events/data over
time
Streams are immutable, data can just be changed
with another stream
Variables with the ability to react to changes
emitted from the data to a certain point
Globalcode – Open4education
Data Model - Streams
“With observables, anything is a stream
and, it is good”
Array Stream
MSFT [$44, $45, $46, $45] {$44.. $45…. $4…. $45}
NFLX [$95, $96, $97, $96, $101] {$95. $96…$97…. $96…}
Globalcode – Open4education
Observables
The most important concept
Wrap a piece of data and decorate it with stream-
like qualities (string, numbers, sets, collections,
websocket, requests, …any)
The most simple is Observable.of(anything)
Globalcode – Open4education
Basic Usage
Promise Observable
.then(valueFn) .subscribe(valueFn, errorFn, completeFn)
.catch(err => Promise.resolve(err)) .catch(err => Observable.of(err))
.finally(() => console.log(‘done’)) .finally(() => console.log(‘done’))
Not cancellable
let sub = observable.subscribe(valueFn)
sub.unsubscribe();
Globalcode – Open4education
Creation from scratch
Promise Observable
new Promise((resolve, reject) => {
asyncFn((err, data) => {
if (err) {
return reject(err);
}
resolve(data);
});
});
new Observable(subscriber => {
asyncFn((err, data) => {
if (err) {
return subscriber.error(err);
}
subscriber.next(data);
subscriber.complete();
});
return () => cancelAnything();
});
Globalcode – Open4education
Quick recap
Set of any amount of things over any amount of
time.
Values are pushed, to subscribers, via nextFn.
Errors are pushed to errFn.
On complete completeFn is called.
By default, they are lazy, nothing is produced until
at least one subscriber.
let sub = observable.subscribe(nextFn, errFn, completeFn)
sub.unsubscribe()
Globalcode – Open4education
RxJS to the rescue
Globalcode – Open4education
What is this?
“RxJS is lodash for async” with Observables
Functional / reactive Programming with
Observables
Handle events, or any source, as stream collections
Many, many, many operators to manipulate sets
Decisions guided by performance
Contributors at Netflix, Google and Microsoft
Globalcode – Open4education
Creation helpers
Observable.of(…values);
Observable.from(typeof promise / iterable)
Observable.fromEvent(item, eventName)
Observable.fromPromise(PromiseLike)
Observable.fromCallback((callback) => ..);
Observable.fromNodeCallback((err, callback) => ..);
Observable.interval(number);
range(number, number);
Observable…
Globalcode – Open4education
Can be retried / repeated
// retry three times on fail
Observable.retry(3);
// retry always on fail
Observable.retry();
// retry after 1,5s on fail
Observable.retryWhen(errors => errors.delay(1500));
// always repeat on complete
Observable.repeat();
// repeat twice
Observable.repeat(2);
Globalcode – Open4education
Can be combined / connected
// combine values whenever any emit
Observable.combineLatest(…Observables);
// emits all when all completes
Observable.forkJoin(…Observables);
// emit chunks when all at same index have emitted
Observable.zip(…Observables);
// parallel combination
Observable.merge(…Observables);
// serial combination
Observable.concat(…Observables);
// connect streams with merge strategy
Observable.mergeMap(() => Observable);
Globalcode – Open4education
Operators - The real power
Globalcode – Open4education
Operators - What is this
Methods to compose Observables and create new
ones.
let mapped = Observable.interval(1000)
.filter(value => value % 2)
.map(value => value * 3)
.take(3);
Mapped is a new Observable that when subscribed,
subscribes to interval observable and theirs operators.
Globalcode – Open4education
Operators - How they work
Operators pass each value from one to the next,
before process next set’s value, like lazy evaluation.
Different from array operators, which process whole
array, creating intermediates for each step.
Globalcode – Open4education
Arrays way
Items.filter(notRed).map(toScale).take(3);
Globalcode – Open4education
Operators way
Items.filter(notRed).map(toScale).take(3);
Globalcode – Open4education
Some operators
Basic
map, reduce, filter, first, last, toArray,
take, skip, scan, repeat, max, min,
expand, forEach, do, pluck, …
Merging and joining
merge, concat, mergeMap, concatMap,
switchMap, forkJoin, race,
combineLatest, zip, …
Splitting and grouping
groupBy, window, partition, pairwise,
withLatestFrom, …
Buffer and backpressure
Buffer, throttle, debounce, sample,
distinctUntilChanged, …
Fail tolerance and redundancy strategies
catch, retry, retryWhen,
onErrorResumeNext, publishReplay, …
Globalcode – Open4education
Hot vs. Cold
Observables are “cold” by default
Cold observables create a new producer each time
a subscriber subscribes to them.
Hot observables share a single producer with every
subscriber. And optionally can emit values without
any subscriber (Like mouse events).
Globalcode – Open4education
Use Case - Resilient Websocket
Connect to a web socket server
For each subscriber
Send subscription to server
Filter desired responses
When done, unsubscribe
Ideally, keep socket opened just while data is
required
Globalcode – Open4education
Use Case - Resilient Websocket
On connection fail
Keep state of all subscribers
Check when able to reconnect
Reconnect
Once reconnected, send subscriptions again
Keep consuming
Globalcode – Open4education
Use Case - Resilient Websocket
http://tdc-rxjs.herokuapp.com
https://github.com/feliperohdee/tdc-rxjs-demo
Globalcode – Open4education
Use case - Websocket
Observable
Globalcode – Open4education
Use case - Resilient web socket
Globalcode – Open4education
Felipe Rohde
felipe@smallorange.co
facebook.com/feliperohdee
github.com/feliperohdee
https://www.npmjs.com/package/one-framework

Mais conteúdo relacionado

Mais procurados

Reactive programming using rx java & akka actors - pdx-scala - june 2014
Reactive programming   using rx java & akka actors - pdx-scala - june 2014Reactive programming   using rx java & akka actors - pdx-scala - june 2014
Reactive programming using rx java & akka actors - pdx-scala - june 2014Thomas Lockney
 
GKAC 2015 Apr. - RxAndroid
GKAC 2015 Apr. - RxAndroidGKAC 2015 Apr. - RxAndroid
GKAC 2015 Apr. - RxAndroidGDG Korea
 
Android architecture component - FbCircleDev Yogyakarta Indonesia
Android architecture component - FbCircleDev Yogyakarta IndonesiaAndroid architecture component - FbCircleDev Yogyakarta Indonesia
Android architecture component - FbCircleDev Yogyakarta IndonesiaPratama Nur Wijaya
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaRick Warren
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examplesPeter Lawrey
 
Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJSBrainhub
 
Intro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich AndroidIntro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich AndroidEgor Andreevich
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for AndroidTomáš Kypta
 
RxJava from the trenches
RxJava from the trenchesRxJava from the trenches
RxJava from the trenchesPeter Hendriks
 
RxJava for Android - GDG DevFest Ukraine 2015
RxJava for Android - GDG DevFest Ukraine 2015RxJava for Android - GDG DevFest Ukraine 2015
RxJava for Android - GDG DevFest Ukraine 2015Constantine Mars
 
Reactive mistakes reactive nyc
Reactive mistakes   reactive nycReactive mistakes   reactive nyc
Reactive mistakes reactive nycPetr Zapletal
 
Distributed Real-Time Stream Processing: Why and How 2.0
Distributed Real-Time Stream Processing:  Why and How 2.0Distributed Real-Time Stream Processing:  Why and How 2.0
Distributed Real-Time Stream Processing: Why and How 2.0Petr Zapletal
 
Reactive Android: RxJava and beyond
Reactive Android: RxJava and beyondReactive Android: RxJava and beyond
Reactive Android: RxJava and beyondFabio Tiriticco
 
Kogito: cloud native business automation
Kogito: cloud native business automationKogito: cloud native business automation
Kogito: cloud native business automationMario Fusco
 
Angular Advanced Workshop (+ Challenges)
Angular Advanced Workshop (+ Challenges)Angular Advanced Workshop (+ Challenges)
Angular Advanced Workshop (+ Challenges)Georgios Kaleadis
 
Reactive by example - at Reversim Summit 2015
Reactive by example - at Reversim Summit 2015Reactive by example - at Reversim Summit 2015
Reactive by example - at Reversim Summit 2015Eran Harel
 

Mais procurados (20)

Reactive programming using rx java & akka actors - pdx-scala - june 2014
Reactive programming   using rx java & akka actors - pdx-scala - june 2014Reactive programming   using rx java & akka actors - pdx-scala - june 2014
Reactive programming using rx java & akka actors - pdx-scala - june 2014
 
RxJava in practice
RxJava in practice RxJava in practice
RxJava in practice
 
GKAC 2015 Apr. - RxAndroid
GKAC 2015 Apr. - RxAndroidGKAC 2015 Apr. - RxAndroid
GKAC 2015 Apr. - RxAndroid
 
Android architecture component - FbCircleDev Yogyakarta Indonesia
Android architecture component - FbCircleDev Yogyakarta IndonesiaAndroid architecture component - FbCircleDev Yogyakarta Indonesia
Android architecture component - FbCircleDev Yogyakarta Indonesia
 
Building Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJavaBuilding Scalable Stateless Applications with RxJava
Building Scalable Stateless Applications with RxJava
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
RxJava on Android
RxJava on AndroidRxJava on Android
RxJava on Android
 
Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJS
 
Intro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich AndroidIntro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich Android
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for Android
 
RxJava from the trenches
RxJava from the trenchesRxJava from the trenches
RxJava from the trenches
 
RxJava for Android - GDG DevFest Ukraine 2015
RxJava for Android - GDG DevFest Ukraine 2015RxJava for Android - GDG DevFest Ukraine 2015
RxJava for Android - GDG DevFest Ukraine 2015
 
Reactive mistakes reactive nyc
Reactive mistakes   reactive nycReactive mistakes   reactive nyc
Reactive mistakes reactive nyc
 
Distributed Real-Time Stream Processing: Why and How 2.0
Distributed Real-Time Stream Processing:  Why and How 2.0Distributed Real-Time Stream Processing:  Why and How 2.0
Distributed Real-Time Stream Processing: Why and How 2.0
 
Reactive Android: RxJava and beyond
Reactive Android: RxJava and beyondReactive Android: RxJava and beyond
Reactive Android: RxJava and beyond
 
Javantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
Javantura v3 - Going Reactive with RxJava – Hrvoje CrnjakJavantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
Javantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
 
Reactive Java (33rd Degree)
Reactive Java (33rd Degree)Reactive Java (33rd Degree)
Reactive Java (33rd Degree)
 
Kogito: cloud native business automation
Kogito: cloud native business automationKogito: cloud native business automation
Kogito: cloud native business automation
 
Angular Advanced Workshop (+ Challenges)
Angular Advanced Workshop (+ Challenges)Angular Advanced Workshop (+ Challenges)
Angular Advanced Workshop (+ Challenges)
 
Reactive by example - at Reversim Summit 2015
Reactive by example - at Reversim Summit 2015Reactive by example - at Reversim Summit 2015
Reactive by example - at Reversim Summit 2015
 

Destaque

TDC2016SP - Trilha Microservices
TDC2016SP - Trilha MicroservicesTDC2016SP - Trilha Microservices
TDC2016SP - Trilha Microservicestdc-globalcode
 
TDC2016SP - Trilha Microservices
TDC2016SP - Trilha MicroservicesTDC2016SP - Trilha Microservices
TDC2016SP - Trilha Microservicestdc-globalcode
 
TDC2016SP - Trilha Microservices
TDC2016SP - Trilha MicroservicesTDC2016SP - Trilha Microservices
TDC2016SP - Trilha Microservicestdc-globalcode
 
TDC2016SP - Trilha Impressão 3D
TDC2016SP - Trilha Impressão 3DTDC2016SP - Trilha Impressão 3D
TDC2016SP - Trilha Impressão 3Dtdc-globalcode
 
TDC2016SP - Trilha Impressão 3D
TDC2016SP - Trilha Impressão 3DTDC2016SP - Trilha Impressão 3D
TDC2016SP - Trilha Impressão 3Dtdc-globalcode
 
Tomada de Decisão baseada em testes de carga - The Developer`s Conference Sã...
Tomada de Decisão baseada em testes de carga - The Developer`s Conference Sã...Tomada de Decisão baseada em testes de carga - The Developer`s Conference Sã...
Tomada de Decisão baseada em testes de carga - The Developer`s Conference Sã...Edlaine Zamora
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLtdc-globalcode
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLtdc-globalcode
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLtdc-globalcode
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLtdc-globalcode
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLtdc-globalcode
 
TDC2016SP - Trilha Startups
TDC2016SP - Trilha StartupsTDC2016SP - Trilha Startups
TDC2016SP - Trilha Startupstdc-globalcode
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLtdc-globalcode
 
TDC2016SP - Trilha Startups
TDC2016SP - Trilha StartupsTDC2016SP - Trilha Startups
TDC2016SP - Trilha Startupstdc-globalcode
 
Testando sua aplicação asp.net mvc de forma automatizada de ponta a ponta
Testando sua aplicação asp.net mvc de forma automatizada de ponta a pontaTestando sua aplicação asp.net mvc de forma automatizada de ponta a ponta
Testando sua aplicação asp.net mvc de forma automatizada de ponta a pontatdc-globalcode
 
TDC2016SP - Trilha Node.Js
TDC2016SP - Trilha Node.JsTDC2016SP - Trilha Node.Js
TDC2016SP - Trilha Node.Jstdc-globalcode
 
TDC2016POA | Trilha Arquitetura - Onion Architecture
TDC2016POA | Trilha Arquitetura - Onion ArchitectureTDC2016POA | Trilha Arquitetura - Onion Architecture
TDC2016POA | Trilha Arquitetura - Onion Architecturetdc-globalcode
 
TDC2016POA | Trilha Arquitetura - CQRS e Event Driven Architecture valem a p...
TDC2016POA | Trilha Arquitetura -  CQRS e Event Driven Architecture valem a p...TDC2016POA | Trilha Arquitetura -  CQRS e Event Driven Architecture valem a p...
TDC2016POA | Trilha Arquitetura - CQRS e Event Driven Architecture valem a p...tdc-globalcode
 

Destaque (20)

Code smells in PHP
Code smells in PHPCode smells in PHP
Code smells in PHP
 
TDC2016SP - Trilha Microservices
TDC2016SP - Trilha MicroservicesTDC2016SP - Trilha Microservices
TDC2016SP - Trilha Microservices
 
Doctrine for Dummies
Doctrine for DummiesDoctrine for Dummies
Doctrine for Dummies
 
TDC2016SP - Trilha Microservices
TDC2016SP - Trilha MicroservicesTDC2016SP - Trilha Microservices
TDC2016SP - Trilha Microservices
 
TDC2016SP - Trilha Microservices
TDC2016SP - Trilha MicroservicesTDC2016SP - Trilha Microservices
TDC2016SP - Trilha Microservices
 
TDC2016SP - Trilha Impressão 3D
TDC2016SP - Trilha Impressão 3DTDC2016SP - Trilha Impressão 3D
TDC2016SP - Trilha Impressão 3D
 
TDC2016SP - Trilha Impressão 3D
TDC2016SP - Trilha Impressão 3DTDC2016SP - Trilha Impressão 3D
TDC2016SP - Trilha Impressão 3D
 
Tomada de Decisão baseada em testes de carga - The Developer`s Conference Sã...
Tomada de Decisão baseada em testes de carga - The Developer`s Conference Sã...Tomada de Decisão baseada em testes de carga - The Developer`s Conference Sã...
Tomada de Decisão baseada em testes de carga - The Developer`s Conference Sã...
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQL
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQL
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQL
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQL
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQL
 
TDC2016SP - Trilha Startups
TDC2016SP - Trilha StartupsTDC2016SP - Trilha Startups
TDC2016SP - Trilha Startups
 
TDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQLTDC2016SP - Trilha NoSQL
TDC2016SP - Trilha NoSQL
 
TDC2016SP - Trilha Startups
TDC2016SP - Trilha StartupsTDC2016SP - Trilha Startups
TDC2016SP - Trilha Startups
 
Testando sua aplicação asp.net mvc de forma automatizada de ponta a ponta
Testando sua aplicação asp.net mvc de forma automatizada de ponta a pontaTestando sua aplicação asp.net mvc de forma automatizada de ponta a ponta
Testando sua aplicação asp.net mvc de forma automatizada de ponta a ponta
 
TDC2016SP - Trilha Node.Js
TDC2016SP - Trilha Node.JsTDC2016SP - Trilha Node.Js
TDC2016SP - Trilha Node.Js
 
TDC2016POA | Trilha Arquitetura - Onion Architecture
TDC2016POA | Trilha Arquitetura - Onion ArchitectureTDC2016POA | Trilha Arquitetura - Onion Architecture
TDC2016POA | Trilha Arquitetura - Onion Architecture
 
TDC2016POA | Trilha Arquitetura - CQRS e Event Driven Architecture valem a p...
TDC2016POA | Trilha Arquitetura -  CQRS e Event Driven Architecture valem a p...TDC2016POA | Trilha Arquitetura -  CQRS e Event Driven Architecture valem a p...
TDC2016POA | Trilha Arquitetura - CQRS e Event Driven Architecture valem a p...
 

Semelhante a TDC2016SP - Trilha Node.Js

RxJava2 Slides
RxJava2 SlidesRxJava2 Slides
RxJava2 SlidesYarikS
 
RxJava 2 Reactive extensions for the JVM
RxJava 2  Reactive extensions for the JVMRxJava 2  Reactive extensions for the JVM
RxJava 2 Reactive extensions for the JVMNetesh Kumar
 
RDF Stream Processing: Let's React
RDF Stream Processing: Let's ReactRDF Stream Processing: Let's React
RDF Stream Processing: Let's ReactJean-Paul Calbimonte
 
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...Codemotion
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingFabio Tiriticco
 
Introduction to Reactive programming
Introduction to Reactive programmingIntroduction to Reactive programming
Introduction to Reactive programmingDwi Randy Herdinanto
 
The hitchhiker’s guide to Prometheus
The hitchhiker’s guide to PrometheusThe hitchhiker’s guide to Prometheus
The hitchhiker’s guide to PrometheusBol.com Techlab
 
The hitchhiker’s guide to Prometheus
The hitchhiker’s guide to PrometheusThe hitchhiker’s guide to Prometheus
The hitchhiker’s guide to PrometheusBol.com Techlab
 
Андрій Рева, "How to build reactive java application"
Андрій Рева, "How to build reactive java application"Андрій Рева, "How to build reactive java application"
Андрій Рева, "How to build reactive java application"Sigma Software
 
Reactive Applications with Apache Pulsar and Spring Boot
Reactive Applications with Apache Pulsar and Spring BootReactive Applications with Apache Pulsar and Spring Boot
Reactive Applications with Apache Pulsar and Spring BootVMware Tanzu
 
Reactive programming and RxJS
Reactive programming and RxJSReactive programming and RxJS
Reactive programming and RxJSRavi Mone
 
Workshop: Introduction to Performance and Load Testing with k6
Workshop: Introduction to Performance and Load Testing with k6Workshop: Introduction to Performance and Load Testing with k6
Workshop: Introduction to Performance and Load Testing with k6Applitools
 
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016Trayan Iliev
 
Reactive programming with rx java
Reactive programming with rx javaReactive programming with rx java
Reactive programming with rx javaCongTrung Vnit
 
Node.js: CAMTA Presentation
Node.js: CAMTA PresentationNode.js: CAMTA Presentation
Node.js: CAMTA PresentationRob Tweed
 
IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016Trayan Iliev
 
Functional reactive programming
Functional reactive programmingFunctional reactive programming
Functional reactive programmingAraf Karsh Hamid
 

Semelhante a TDC2016SP - Trilha Node.Js (20)

RxJava@Android
RxJava@AndroidRxJava@Android
RxJava@Android
 
RxJava2 Slides
RxJava2 SlidesRxJava2 Slides
RxJava2 Slides
 
RxJava 2 Reactive extensions for the JVM
RxJava 2  Reactive extensions for the JVMRxJava 2  Reactive extensions for the JVM
RxJava 2 Reactive extensions for the JVM
 
Mini training - Reactive Extensions (Rx)
Mini training - Reactive Extensions (Rx)Mini training - Reactive Extensions (Rx)
Mini training - Reactive Extensions (Rx)
 
RDF Stream Processing: Let's React
RDF Stream Processing: Let's ReactRDF Stream Processing: Let's React
RDF Stream Processing: Let's React
 
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
 
Beyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor ProgrammingBeyond Fault Tolerance with Actor Programming
Beyond Fault Tolerance with Actor Programming
 
Introduction to Reactive programming
Introduction to Reactive programmingIntroduction to Reactive programming
Introduction to Reactive programming
 
The hitchhiker’s guide to Prometheus
The hitchhiker’s guide to PrometheusThe hitchhiker’s guide to Prometheus
The hitchhiker’s guide to Prometheus
 
The hitchhiker’s guide to Prometheus
The hitchhiker’s guide to PrometheusThe hitchhiker’s guide to Prometheus
The hitchhiker’s guide to Prometheus
 
Prometheus monitoring
Prometheus monitoringPrometheus monitoring
Prometheus monitoring
 
Андрій Рева, "How to build reactive java application"
Андрій Рева, "How to build reactive java application"Андрій Рева, "How to build reactive java application"
Андрій Рева, "How to build reactive java application"
 
Reactive Applications with Apache Pulsar and Spring Boot
Reactive Applications with Apache Pulsar and Spring BootReactive Applications with Apache Pulsar and Spring Boot
Reactive Applications with Apache Pulsar and Spring Boot
 
Reactive programming and RxJS
Reactive programming and RxJSReactive programming and RxJS
Reactive programming and RxJS
 
Workshop: Introduction to Performance and Load Testing with k6
Workshop: Introduction to Performance and Load Testing with k6Workshop: Introduction to Performance and Load Testing with k6
Workshop: Introduction to Performance and Load Testing with k6
 
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
 
Reactive programming with rx java
Reactive programming with rx javaReactive programming with rx java
Reactive programming with rx java
 
Node.js: CAMTA Presentation
Node.js: CAMTA PresentationNode.js: CAMTA Presentation
Node.js: CAMTA Presentation
 
IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016IPT High Performance Reactive Java BGOUG 2016
IPT High Performance Reactive Java BGOUG 2016
 
Functional reactive programming
Functional reactive programmingFunctional reactive programming
Functional reactive programming
 

Mais de tdc-globalcode

TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidadeTDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidadetdc-globalcode
 
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...tdc-globalcode
 
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
TDC2019 Intel Software Day - ACATE - Cases de SucessoTDC2019 Intel Software Day - ACATE - Cases de Sucesso
TDC2019 Intel Software Day - ACATE - Cases de Sucessotdc-globalcode
 
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPATDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPAtdc-globalcode
 
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVinoTDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVinotdc-globalcode
 
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...tdc-globalcode
 
TDC2019 Intel Software Day - Inferencia de IA em edge devices
TDC2019 Intel Software Day - Inferencia de IA em edge devicesTDC2019 Intel Software Day - Inferencia de IA em edge devices
TDC2019 Intel Software Day - Inferencia de IA em edge devicestdc-globalcode
 
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca PublicaTrilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publicatdc-globalcode
 
Trilha .Net - Programacao funcional usando f#
Trilha .Net - Programacao funcional usando f#Trilha .Net - Programacao funcional usando f#
Trilha .Net - Programacao funcional usando f#tdc-globalcode
 
TDC2018SP | Trilha Go - Case Easylocus
TDC2018SP | Trilha Go - Case EasylocusTDC2018SP | Trilha Go - Case Easylocus
TDC2018SP | Trilha Go - Case Easylocustdc-globalcode
 
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?tdc-globalcode
 
TDC2018SP | Trilha Go - Clean architecture em Golang
TDC2018SP | Trilha Go - Clean architecture em GolangTDC2018SP | Trilha Go - Clean architecture em Golang
TDC2018SP | Trilha Go - Clean architecture em Golangtdc-globalcode
 
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QATDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QAtdc-globalcode
 
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendenciaTDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendenciatdc-globalcode
 
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR ServiceTDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Servicetdc-globalcode
 
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NETTDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NETtdc-globalcode
 
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8tdc-globalcode
 
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...tdc-globalcode
 
TDC2018SP | Trilha .Net - .NET funcional com F#
TDC2018SP | Trilha .Net - .NET funcional com F#TDC2018SP | Trilha .Net - .NET funcional com F#
TDC2018SP | Trilha .Net - .NET funcional com F#tdc-globalcode
 
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor  em .Net CoreTDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor  em .Net Core
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Coretdc-globalcode
 

Mais de tdc-globalcode (20)

TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidadeTDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
TDC2019 Intel Software Day - Visao Computacional e IA a servico da humanidade
 
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
TDC2019 Intel Software Day - Tecnicas de Programacao Paralela em Machine Lear...
 
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
TDC2019 Intel Software Day - ACATE - Cases de SucessoTDC2019 Intel Software Day - ACATE - Cases de Sucesso
TDC2019 Intel Software Day - ACATE - Cases de Sucesso
 
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPATDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
TDC2019 Intel Software Day - Otimizacao grafica com o Intel GPA
 
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVinoTDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
TDC2019 Intel Software Day - Deteccao de objetos em tempo real com OpenVino
 
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
TDC2019 Intel Software Day - OpenCV: Inteligencia artificial e Visao Computac...
 
TDC2019 Intel Software Day - Inferencia de IA em edge devices
TDC2019 Intel Software Day - Inferencia de IA em edge devicesTDC2019 Intel Software Day - Inferencia de IA em edge devices
TDC2019 Intel Software Day - Inferencia de IA em edge devices
 
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca PublicaTrilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
Trilha BigData - Banco de Dados Orientado a Grafos na Seguranca Publica
 
Trilha .Net - Programacao funcional usando f#
Trilha .Net - Programacao funcional usando f#Trilha .Net - Programacao funcional usando f#
Trilha .Net - Programacao funcional usando f#
 
TDC2018SP | Trilha Go - Case Easylocus
TDC2018SP | Trilha Go - Case EasylocusTDC2018SP | Trilha Go - Case Easylocus
TDC2018SP | Trilha Go - Case Easylocus
 
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
TDC2018SP | Trilha Modern Web - Para onde caminha a Web?
 
TDC2018SP | Trilha Go - Clean architecture em Golang
TDC2018SP | Trilha Go - Clean architecture em GolangTDC2018SP | Trilha Go - Clean architecture em Golang
TDC2018SP | Trilha Go - Clean architecture em Golang
 
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QATDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
TDC2018SP | Trilha Go - "Go" tambem e linguagem de QA
 
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendenciaTDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
TDC2018SP | Trilha Mobile - Digital Wallets - Seguranca, inovacao e tendencia
 
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR ServiceTDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
TDC2018SP | Trilha .Net - Real Time apps com Azure SignalR Service
 
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NETTDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
TDC2018SP | Trilha .Net - Passado, Presente e Futuro do .NET
 
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
TDC2018SP | Trilha .Net - Novidades do C# 7 e 8
 
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
TDC2018SP | Trilha .Net - Obtendo metricas com TDD utilizando build automatiz...
 
TDC2018SP | Trilha .Net - .NET funcional com F#
TDC2018SP | Trilha .Net - .NET funcional com F#TDC2018SP | Trilha .Net - .NET funcional com F#
TDC2018SP | Trilha .Net - .NET funcional com F#
 
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor  em .Net CoreTDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor  em .Net Core
TDC2018SP | Trilha .Net - Crie SPAs com Razor e C# usando Blazor em .Net Core
 

Último

Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 

Último (20)

Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

TDC2016SP - Trilha Node.Js

  • 1. Globalcode – Open4education Node.js – Reactive Programming with Observables and RxJS Felipe Rohde
  • 2. Globalcode – Open4education Agenda Application goals Async JS Promises vs. Observables Data model - Streams Basic usage Observables Creation from scratch Quick recap RxJS to the rescue What is this Creation helpers Operators “hot" vs. “cold" Use case - Resilient web socket
  • 3. Globalcode – Open4education Application goals Keep responsive all the times - React on load Unacceptable halt while processing Resilient - React on fail - Self recover Reactive Impossible to predict when process will be done Advantage of Async
  • 4. Globalcode – Open4education Async JS Levels of async computations Time and latency become key issues Simple applications “callback" is enough But to scale … hard to maintain, hard to test Async computation is hard to manage
  • 5. Globalcode – Open4education Callback Hell makeHttpCall('/items', items => { for (itemId of items) { makeHttpCall(`/items/${itemId}/info`, itemInfo => { makeHttpCall(`/items/${itemInfo.pic}`, img => { showImg(img); }); }); } });
  • 6. Globalcode – Open4education Async JS Callbacks (Callback Hell) Promises (ES6 Spec) Generators Async / Await Observables (ES7 Spec)
  • 7. Globalcode – Open4education Promises vs. Observables Both are built to solve async problems (to avoid callback hell) The idea of future values Eventual results Code scalability
  • 8. Globalcode – Open4education Promises vs. Observables Fluent interface with notion of time and exposes the method continually Read-only view to a single future value Success and fail semantics via .then() and .catch() Not lazy, once started, it is on the way to being resolved Not cancellable, it will resolve or reject, only once
  • 9. Globalcode – Open4education Promises vs. Observables makeHttpCall('/items') .then(itemId => makeHttpCall(`/items/${itemId}/info`)) .then(itemInfo => makeHttpCall(`/items/${itemInfo}.pic}`)) .then(showImg);
  • 10. Globalcode – Open4education Promises vs. Observables “Streams” or collections Any amount of data Any amount of time Lazy, by default. Just produce values when there are subscribers Can be cancelled, stop producing values Objects that can inform other objects of the changes they publish
  • 11. Globalcode – Open4education Promises vs. Observables Single return value Multiple return values Pull / Sync / Interactive Object Iterables (Array, Set, Map, Object) Push / Async / Reactive Promise Observable “Observables, returns 0 - ∞ values between now and the end of time”
  • 12. Globalcode – Open4education Data Model - Streams Nothing more than a sequence of events/data over time Streams are immutable, data can just be changed with another stream Variables with the ability to react to changes emitted from the data to a certain point
  • 13. Globalcode – Open4education Data Model - Streams “With observables, anything is a stream and, it is good” Array Stream MSFT [$44, $45, $46, $45] {$44.. $45…. $4…. $45} NFLX [$95, $96, $97, $96, $101] {$95. $96…$97…. $96…}
  • 14. Globalcode – Open4education Observables The most important concept Wrap a piece of data and decorate it with stream- like qualities (string, numbers, sets, collections, websocket, requests, …any) The most simple is Observable.of(anything)
  • 15. Globalcode – Open4education Basic Usage Promise Observable .then(valueFn) .subscribe(valueFn, errorFn, completeFn) .catch(err => Promise.resolve(err)) .catch(err => Observable.of(err)) .finally(() => console.log(‘done’)) .finally(() => console.log(‘done’)) Not cancellable let sub = observable.subscribe(valueFn) sub.unsubscribe();
  • 16. Globalcode – Open4education Creation from scratch Promise Observable new Promise((resolve, reject) => { asyncFn((err, data) => { if (err) { return reject(err); } resolve(data); }); }); new Observable(subscriber => { asyncFn((err, data) => { if (err) { return subscriber.error(err); } subscriber.next(data); subscriber.complete(); }); return () => cancelAnything(); });
  • 17. Globalcode – Open4education Quick recap Set of any amount of things over any amount of time. Values are pushed, to subscribers, via nextFn. Errors are pushed to errFn. On complete completeFn is called. By default, they are lazy, nothing is produced until at least one subscriber. let sub = observable.subscribe(nextFn, errFn, completeFn) sub.unsubscribe()
  • 19. Globalcode – Open4education What is this? “RxJS is lodash for async” with Observables Functional / reactive Programming with Observables Handle events, or any source, as stream collections Many, many, many operators to manipulate sets Decisions guided by performance Contributors at Netflix, Google and Microsoft
  • 20. Globalcode – Open4education Creation helpers Observable.of(…values); Observable.from(typeof promise / iterable) Observable.fromEvent(item, eventName) Observable.fromPromise(PromiseLike) Observable.fromCallback((callback) => ..); Observable.fromNodeCallback((err, callback) => ..); Observable.interval(number); range(number, number); Observable…
  • 21. Globalcode – Open4education Can be retried / repeated // retry three times on fail Observable.retry(3); // retry always on fail Observable.retry(); // retry after 1,5s on fail Observable.retryWhen(errors => errors.delay(1500)); // always repeat on complete Observable.repeat(); // repeat twice Observable.repeat(2);
  • 22. Globalcode – Open4education Can be combined / connected // combine values whenever any emit Observable.combineLatest(…Observables); // emits all when all completes Observable.forkJoin(…Observables); // emit chunks when all at same index have emitted Observable.zip(…Observables); // parallel combination Observable.merge(…Observables); // serial combination Observable.concat(…Observables); // connect streams with merge strategy Observable.mergeMap(() => Observable);
  • 24. Globalcode – Open4education Operators - What is this Methods to compose Observables and create new ones. let mapped = Observable.interval(1000) .filter(value => value % 2) .map(value => value * 3) .take(3); Mapped is a new Observable that when subscribed, subscribes to interval observable and theirs operators.
  • 25. Globalcode – Open4education Operators - How they work Operators pass each value from one to the next, before process next set’s value, like lazy evaluation. Different from array operators, which process whole array, creating intermediates for each step.
  • 26. Globalcode – Open4education Arrays way Items.filter(notRed).map(toScale).take(3);
  • 27. Globalcode – Open4education Operators way Items.filter(notRed).map(toScale).take(3);
  • 28. Globalcode – Open4education Some operators Basic map, reduce, filter, first, last, toArray, take, skip, scan, repeat, max, min, expand, forEach, do, pluck, … Merging and joining merge, concat, mergeMap, concatMap, switchMap, forkJoin, race, combineLatest, zip, … Splitting and grouping groupBy, window, partition, pairwise, withLatestFrom, … Buffer and backpressure Buffer, throttle, debounce, sample, distinctUntilChanged, … Fail tolerance and redundancy strategies catch, retry, retryWhen, onErrorResumeNext, publishReplay, …
  • 29. Globalcode – Open4education Hot vs. Cold Observables are “cold” by default Cold observables create a new producer each time a subscriber subscribes to them. Hot observables share a single producer with every subscriber. And optionally can emit values without any subscriber (Like mouse events).
  • 30. Globalcode – Open4education Use Case - Resilient Websocket Connect to a web socket server For each subscriber Send subscription to server Filter desired responses When done, unsubscribe Ideally, keep socket opened just while data is required
  • 31. Globalcode – Open4education Use Case - Resilient Websocket On connection fail Keep state of all subscribers Check when able to reconnect Reconnect Once reconnected, send subscriptions again Keep consuming
  • 32. Globalcode – Open4education Use Case - Resilient Websocket http://tdc-rxjs.herokuapp.com https://github.com/feliperohdee/tdc-rxjs-demo
  • 33. Globalcode – Open4education Use case - Websocket Observable
  • 34. Globalcode – Open4education Use case - Resilient web socket
  • 35. Globalcode – Open4education Felipe Rohde felipe@smallorange.co facebook.com/feliperohdee github.com/feliperohdee https://www.npmjs.com/package/one-framework

Notas do Editor

  1. Se vc n conhecem, provavelmente a chaordic conhece vcs faz personalizações e produtos, emails, então td é super dimensionado felizmente atingi um patamar pars seguir meu sonho vim falar e uma tecnologia disruptiva, na qual, provavelmente, se vc trabalham, ou vierem a trabalhar em uma pequena startup de filmes, a netflix, vcs devem, ou deverão ser bem familiarizados
  2. Um dos fatores mais importantes de qualquer aplicação é permanecer respondia durante todo o tempo. Isto significa q é inaceitável para uma aplicação travar enquanto processa I/O. Ler do disco ou da rede é muito mais lento do que executar uma tarefa na CPU
  3. Tendo em vista que, geralmente falando, as operações de IO (ler o disco ou da própria rede) são muito mais lentas do que instruções executadas na CPU. E que isto se aplica tanto no cliente como no servidor. A primeira solução para executar vários processos paralelo foram os callbacks, que emitem vários processos separados para executar tarefas longas. Uma vez que a tarefa finaliza, a runtime do JS executa o callback com o resultado. O controle do programa não depende do programador (afinal, é impossível prever quando um processo vai completar), mas sim da runtime do JS. É aceitável para aplicações pequenas, porém praticamente impossível para aplicações que vão crescer. O que quero dizer é, tão logo vc precise conectar vários módulos, sua aplicação irá sofrer com callback hell.
  4. Multiple issues Nested functions Welcome to promises in ES6
  5. Promises - Provavelmente um passo na direção certa. A dificuldade de entendimento do código com Promises reduz dramaticamente. Mas Promises tem suas limitações, uma vez que são muito eficientes para se trabalhar com resultados q retornam uma única vez (ou um erro). Também são ineficientes para se trabalhar com eventos, fluxos constantes de dados como streams, ou resiliência de uma maneira simples, uma vez que não há semânticas para cancelamento de eventos, disposição, retentativas, repetições, …, Observables to the rescue
  6. Ele nos traz os conceitos de Observer pattern e programação funcional / reativa junto. O Observer pattern é usado para prover um design aprovado baseado em produtores (Observables) e os consumidores (Observers ou Subscribers), que se inscrevem para receber eventos no decorres o tempo, o que oferece uma boa separação dos dois casos. Mais ainda, conceitos de programação funcional, como códigos declarativos, estruturas de dados imutáveis, e combinação de métodos de uma forma fluente, para se dizer o mínimo. Permite que se escreva códigos expressivos e fáceis de entender como os dados irão se comportar. (bye bye callbacks e promises) Se vc é familiarizado com programação funcional em JS, vc pode pensar em Observables e RXJS como o lodash a programação assíncrona. RxJS introduz uma abrangente tipo estrutura de dados chamada stream
  7. Streams não são nada mais que uma sequencia e eventos através do tempo. Streams podem ser usados para processar qualquer tipo de evento, como clicks de mouses, bytes originados da rede, enfim, qualquer tipo de IO. Você pode pensar em streams como variáveis que possuem a capacidade de reagir a mudanças emitidas por outros eventos de um ponto a outro, e que podem sem interligados uns com os outros, criando uma única rede de streams. O que permite especificar um comportamento dinâmico de um dado de uma maneira declarativa. Em Observables, tudo é stream, e isto é bom.
  8. Stream builder
  9. 120 micro performance tests 10 macro performance tests around common scenarios and bottlenecks
  10. Lazy evaluation