Your SlideShare is downloading. ×
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Anatomy of a Reactive Application
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Anatomy of a Reactive Application

879

Published on

Presentation for the kick-off meeting for the meetup: …

Presentation for the kick-off meeting for the meetup:
"Reactive Programming Enthusiasts Denver". This talks about concurrency, non-blocking, scala, futures, akka, play framework, and other concepts of reactive programming.

Published in: Technology, Education
0 Comments
8 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
879
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
41
Comments
0
Likes
8
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 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
  • 12. Up Next? ! March 2014
  • 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!

×