thoughts about reactive programming

Post on 06-Apr-2017

37 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Thoughts About Reactive Programming

Matheus Moreira

Reactive Programming - What

● ???○ reactive manifesto

■ responsive■ elastic■ resilient■ message driven

○ akka○ micro-architecture style

○ programming paradigm

○ functional programming

Reactive Programming - What

“Reactive programming is programming with asynchronous data streams. (...) On top of that, you are given an amazing toolbox of functions to combine, create and filter any of those streams.”

Reactive Programming - What

● stream○ ongoing events ordered in time...

○ captured asynchronously…

○ by a subscriber

Reactive Programming - What

● toolbox○ create (click)

○ combine (buffer, throttle, map)

○ filter

● functional programming○ reduce, filter, map, flatMap○ declarative vs imperative

■ operation-fusion

Reactive Programming - What

● backpressure○ coping with observables that produce items more rapidly than their

observers (subscribers) consume them■ unbound consumption of resources

○ feedback mechanism

Reactive Programming - Why

● concurrency● composability

○ streams (1)

○ Futures (1, 2, 3)

○ callbacks (1)

● netflix○ entire service layer asynchronous (or it appears to be so)

○ blocking and non-blocking ops hidden behind Observable

● better usage of resources● better error handling / graceful degradation

Reactive Programming - How

● reactive streams○ low level contract (not meant to be a public api)○ different libraries working together, especially back-pressure

● rxjava (netflix)● reactor● spring framework 5.0

○ streams part of web layer (controllers)● akka / akka streams● javascript

○ rxjs○ bacon.js

Reactive Programming - References

● thoughts about reactive programming○ follow the links!

○ notes on reactive programming series on spring's blog offers a

bottom-up perspective that finishes with an interesting big picture

scenario (reactive all the way down)

○ posts on netflix's blog give insights about how reactive programming

can transform your api■ resource allocation■ search for circuit-break pattern too, and hystrix implementation of it■ monitoring

● reactive programming vs reactive systems

Reactive Programming - Chat time!

Let's talk about it!

Matheus Moreira

mmoreira@avenuecode.com

https://br.linkedin.com/in/matheusmoreira

top related