Anatomy of a
Reactive Application
Reactive Programming Enthusiasts Denver
Meet-up Kick-Off
Mark Wilson
Demo Application
Intended to Illustrate some concepts of Reactive
Programming, Introduce:

Scala
Akka
Play!
but the demo is mostly about Non-Blocking
Amdahl’s Law
“… Therefore it is important that the entire solution is
asynchronous and non-blocking. ” - Reactive Manifesto
Futures
A Future is an object holding a value which
may become available at some point.
!
•

A Future is either completed or not completed

•

A completed Future is either:
•

successful (value)

•

or failed (exception)

!
!

import scala.concurrent.ExecutionContext.Implicits.global	
import scala.concurrent._	
val fs: Future[String] = Future { “a” + “b” }	
fs.onComplete {	
case Success(x) => println(x)	
case Failure(e) => throw e	
}
The Fish Store
1. Play GET and POST, non-blocking
2. Akka Actors processing a delivery
Start from the start a most simple web page
Actor
From the book “Akka Concurrency”
by Derek Wyatt
Web Tier (Play)
An open source web application framework, written in
Scala and Java, which follows the model–view–
controller architectural pattern.

Stateless: horizontally scalable
Aims to allow concurrency throughout
the application
Fits with REST/ powerful javascript
Akka
Using the Actor Model we raise the abstraction level and
provide a better platform to build correct, concurrent, and
scalable applications. - akka docs

From the
book “Akka
Concurrency”
by Derek
Wyatt
pipeTo
import akka.pattern.pipe	

!
val future: Future[Any] = someFunctionReturningFuture()	
future pipeTo sender // sends to sender as Future[Any]	

!
// is roughly equivalent to	

!
val mysender = sender // final def sender(): ActorRef	
future.onComplete {	
case Success(x) => mysender ! x	
case Failure(e) => mysender ! akka.actor.Status.Failure(e)	
}	

!
// if sender doesn't handle Failure(e) it is logged as unhandled
Akka More..
Configuration
Akka Test Kit
Akka Extensions
Akka Traits { Stash, ActorLogging }
TypedActor
Akka Events { EventBus, EventStream } - Pub/sub behavior
Akka Scheduler - sending a message to an actor on a schedule.
Super vision/Fault Tolerance { Resume, Restart, Stop, Escalate }
Data Flows - special lib for writing futures: flow { “hi” } onComplete println
Pipeline - sequential processing within an actor
Remote Actors - utilizing actors on remote machines (or clustered machines)
“It is better to fail in originality
than to succeed in imitation.”

–Herman Melville
Up Next?
!

March 2014
RPED Chunk-O-Thon One
March 2014

Collective 3 minute presentations
Open participation
Topics span Reactive Applications
Examples:
Working examples / Shared learning exercise
Well formed problem/question for the group
Weird, funny or unexpected behavior
Realtime UI tricks
Other interesting stuff you come up with
Submissions must be available 1 week prior to meeting
There will be prizes!

More Related Content

PDF
Using Async in your Mobile Apps - Marek Safar
PDF
Async Await for Mobile Apps
PDF
Wire once, rewire twice! (Haskell exchange-2018)
PDF
Reacting to the Isomorphic Buzz
PPTX
Async CTP 3 Presentation for MUGH 2012
PDF
Concurrency and scalability with akka
PDF
Asynchronous javascript
PDF
Automating EVA Workflows with AWS Step Functions
Using Async in your Mobile Apps - Marek Safar
Async Await for Mobile Apps
Wire once, rewire twice! (Haskell exchange-2018)
Reacting to the Isomorphic Buzz
Async CTP 3 Presentation for MUGH 2012
Concurrency and scalability with akka
Asynchronous javascript
Automating EVA Workflows with AWS Step Functions

What's hot (20)

PDF
Variables in Pharo5
PDF
stackconf 2020 | Real Continuous Deployment of JVM applications by Nicolas Fr...
PPTX
Actor-based concurrency and Akka Fundamentals
PPTX
Async and Await on the Server
PDF
Dynamically Composing Collection Operations through Collection Promises
PDF
Reflection in Pharo: Beyond Smalltak
PDF
A gentle introduction into AKKA and the actor model
PPTX
C# Async on iOS and Android - Miguel de Icaza, CTO of Xamarin
PPTX
End to-end async and await
PDF
Reflection in Pharo: Beyond Smalltak
PDF
Intro to javascript (4 week)
PDF
Asynchronous JavaScript Programming with Callbacks & Promises
PDF
Reflection in Pharo5
KEY
Herding a Cat with Antlers - Catalyst 5.80
PDF
Going Serverless
PPTX
Async in .NET
PDF
DRAKON Visual Language: Tutorial. Part 2
PPTX
High Performance Serverless Functions in Scala
PDF
RxSwift for Beginners - how to avoid a headache of reactive programming
PPT
Asynchronous handlers in asp.net
Variables in Pharo5
stackconf 2020 | Real Continuous Deployment of JVM applications by Nicolas Fr...
Actor-based concurrency and Akka Fundamentals
Async and Await on the Server
Dynamically Composing Collection Operations through Collection Promises
Reflection in Pharo: Beyond Smalltak
A gentle introduction into AKKA and the actor model
C# Async on iOS and Android - Miguel de Icaza, CTO of Xamarin
End to-end async and await
Reflection in Pharo: Beyond Smalltak
Intro to javascript (4 week)
Asynchronous JavaScript Programming with Callbacks & Promises
Reflection in Pharo5
Herding a Cat with Antlers - Catalyst 5.80
Going Serverless
Async in .NET
DRAKON Visual Language: Tutorial. Part 2
High Performance Serverless Functions in Scala
RxSwift for Beginners - how to avoid a headache of reactive programming
Asynchronous handlers in asp.net
Ad

Viewers also liked (6)

ODP
Build your reactive web application with Vert.x
PDF
Flash Platform Ovierview
PPTX
Evolution of front end architectures
PDF
Data Science as a Commodity: Use MADlib, R, & other OSS Tools for Data Scienc...
PPTX
Cycle.js a reactive framework
PDF
Next generation of frontend architectures
Build your reactive web application with Vert.x
Flash Platform Ovierview
Evolution of front end architectures
Data Science as a Commodity: Use MADlib, R, & other OSS Tools for Data Scienc...
Cycle.js a reactive framework
Next generation of frontend architectures
Ad

Similar to Anatomy of a Reactive Application (20)

PPTX
Nairobi JVM meetup : Introduction to akka
 
PDF
Akka and futures
PDF
Writing Asynchronous Programs with Scala & Akka
PDF
Akka Futures and Akka Remoting
PDF
Effective Akka v2
PDF
Reactive programming with akka
PDF
Building Massively Scalable application with Akka 2.0
PPTX
Scale up your thinking
PPTX
Building Reactive System with Akka
PDF
Spring Boot Microservices vs Akka Actor Cluster
PDF
Reactive programming with akka
PDF
Reactive Programming in Akka
PDF
Back to the futures, actors and pipes: using Akka for large-scale data migration
PDF
Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems
PPTX
The dark side of Akka and the remedy - bp.scala meetup
PDF
Building Reactive applications with Akka
PDF
Recipes to develop a reactive and cloud-ready application using Scala and Akka
PDF
Reactive programming using rx java & akka actors - pdx-scala - june 2014
PDF
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
PDF
Reactive Web-Applications @ LambdaDays
Nairobi JVM meetup : Introduction to akka
 
Akka and futures
Writing Asynchronous Programs with Scala & Akka
Akka Futures and Akka Remoting
Effective Akka v2
Reactive programming with akka
Building Massively Scalable application with Akka 2.0
Scale up your thinking
Building Reactive System with Akka
Spring Boot Microservices vs Akka Actor Cluster
Reactive programming with akka
Reactive Programming in Akka
Back to the futures, actors and pipes: using Akka for large-scale data migration
Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems
The dark side of Akka and the remedy - bp.scala meetup
Building Reactive applications with Akka
Recipes to develop a reactive and cloud-ready application using Scala and Akka
Reactive programming using rx java & akka actors - pdx-scala - june 2014
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Reactive Web-Applications @ LambdaDays

Recently uploaded (20)

PPTX
Training Program for knowledge in solar cell and solar industry
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PPTX
Internet of Everything -Basic concepts details
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
PPTX
Microsoft User Copilot Training Slide Deck
PDF
Co-training pseudo-labeling for text classification with support vector machi...
PDF
LMS bot: enhanced learning management systems for improved student learning e...
PDF
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
Training Program for knowledge in solar cell and solar industry
Comparative analysis of machine learning models for fake news detection in so...
Connector Corner: Transform Unstructured Documents with Agentic Automation
Early detection and classification of bone marrow changes in lumbar vertebrae...
Module 1 Introduction to Web Programming .pptx
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
Rapid Prototyping: A lecture on prototyping techniques for interface design
Electrocardiogram sequences data analytics and classification using unsupervi...
MuleSoft-Compete-Deck for midddleware integrations
Data Virtualization in Action: Scaling APIs and Apps with FME
Internet of Everything -Basic concepts details
SGT Report The Beast Plan and Cyberphysical Systems of Control
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
Microsoft User Copilot Training Slide Deck
Co-training pseudo-labeling for text classification with support vector machi...
LMS bot: enhanced learning management systems for improved student learning e...
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf

Anatomy of a Reactive Application

  • 1. Anatomy of a Reactive Application Reactive Programming Enthusiasts Denver Meet-up Kick-Off Mark Wilson
  • 2. Demo Application Intended to Illustrate some concepts of Reactive Programming, Introduce: Scala Akka Play! but the demo is mostly about Non-Blocking
  • 3. Amdahl’s Law “… Therefore it is important that the entire solution is asynchronous and non-blocking. ” - Reactive Manifesto
  • 4. Futures A Future is an object holding a value which may become available at some point. ! • A Future is either completed or not completed • A completed Future is either: • successful (value) • or failed (exception) ! ! import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent._ val fs: Future[String] = Future { “a” + “b” } fs.onComplete { case Success(x) => println(x) case Failure(e) => throw e }
  • 5. The Fish Store 1. Play GET and POST, non-blocking 2. Akka Actors processing a delivery Start from the start a most simple web page
  • 6. Actor From the book “Akka Concurrency” by Derek Wyatt
  • 7. Web Tier (Play) An open source web application framework, written in Scala and Java, which follows the model–view– controller architectural pattern. Stateless: horizontally scalable Aims to allow concurrency throughout the application Fits with REST/ powerful javascript
  • 8. Akka Using the Actor Model we raise the abstraction level and provide a better platform to build correct, concurrent, and scalable applications. - akka docs From the book “Akka Concurrency” by Derek Wyatt
  • 9. pipeTo import akka.pattern.pipe ! val future: Future[Any] = someFunctionReturningFuture() future pipeTo sender // sends to sender as Future[Any] ! // is roughly equivalent to ! val mysender = sender // final def sender(): ActorRef future.onComplete { case Success(x) => mysender ! x case Failure(e) => mysender ! akka.actor.Status.Failure(e) } ! // if sender doesn't handle Failure(e) it is logged as unhandled
  • 10. Akka More.. Configuration Akka Test Kit Akka Extensions Akka Traits { Stash, ActorLogging } TypedActor Akka Events { EventBus, EventStream } - Pub/sub behavior Akka Scheduler - sending a message to an actor on a schedule. Super vision/Fault Tolerance { Resume, Restart, Stop, Escalate } Data Flows - special lib for writing futures: flow { “hi” } onComplete println Pipeline - sequential processing within an actor Remote Actors - utilizing actors on remote machines (or clustered machines)
  • 11. “It is better to fail in originality than to succeed in imitation.” –Herman Melville
  • 13. RPED Chunk-O-Thon One March 2014 Collective 3 minute presentations Open participation Topics span Reactive Applications Examples: Working examples / Shared learning exercise Well formed problem/question for the group Weird, funny or unexpected behavior Realtime UI tricks Other interesting stuff you come up with Submissions must be available 1 week prior to meeting There will be prizes!