reactive application

Post on 08-May-2015

243 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Talk about Functional application and Reactive application with example of Scala Future, Akka actors and a chat using the latest play framework version

TRANSCRIPT

Reactive Application

Christophe Marchal Rafael Souza@toff63 @rafael_psouza

Object Oriented ProgrammingHard to reuse objects

Functional ProgrammingEasy to reuse small functions

Functional Paradigm: Composition

“In modern applications involving highly concurrent computing on multicore machines, state is the problem”

Functional programming: A step backward - infoworld.com

Functional Paradigm: Stateless

Evolution of large applications

Response Time

Uptime

Data Size

Hosting

“reacting to events or situations rather than acting first to change or prevent something”

Cambridge

“Showing a response to a stimulus” Oxford

What Reactive means?

Reactive traits

Scaling up

Scaling out

Concurrency handled by container

More user, more thread

Efficiency issue

Thread dump result

Computer time scale

Paradigm shift: Event driven

Scala Future

Handling failure

Traditional Failure Handling

Node stop responding

Domino effect

Bulkhead pattern

● Stateful

● Asynchronous

● Only communicate through message

Create Bulk: Actors

Actor tree

Akka: Supervision

Akka: Supervision

Streaming data to the screen

Using Play! 2.3-M2

Websocket

Controller

Backend Actor

Thanks!Obrigado!

Christophe Marchal Rafael Souza@toff63 @rafael_psouza

top related