SlideShare a Scribd company logo
Globus
Scala Laboratory. Iteration #3
Goals of the iteration
● change server-side of Globus Project to use Actors
○ if you already have layer of services, they can be
transformed into actors
○ if you don’t have services, refactor the the code
Actor’s concept
● invented in 70th
● popularized in 80th in Erlang (OTP
Framework)
Why Actors?
● straightforward concurrency
● simple design
● easy to scale to multiple nodes
○ location transparency
● toolkit for building fault-tolerant systems
Actor-based systems
Key concepts:
● actor
● supervisor
● dispatcher
Actors in Akka
1. class MyActor extends Actor {
2. val log = Logging(context.system, this)
3. def receive = {
4. case Ping(message) => log.info(message)
5. }
6. }
Supervisors
● “when someone dies, others will notice”, Joe
Armstrong
● when error occurs in an actor, it dies
● 2 actors may be linked
● when 1 actor dies, another dies as well
○ or, it may handle the error (supervise another actor)
Supervisors in Akka
1. class FirstActor extends Actor {
2. val child = context.actorOf(Props[MyActor], name =
"myChild")
3. // plus some behavior ...
4. }
Supervisors in Akka, II
● when child dies, supervisor receives
Terminated(`child`)
Supervisors: real-world example
● see http://www.slideshare.net/remeniuk/a-
million-bots-cant-be-wrong (slides 10-19)
Dispatchers
● provide “resources” for actors to process the
message
○ Dispatcher
○ PinnedDispatcher
○ BalancingDispatcher
○ CallingThreadDispatcher
Dispatchers: real-world example
● http://www.slideshare.net/remeniuk/a-million-
bots-cant-be-wrong (slides 35-42)

More Related Content

PDF
Ansible Galaxy @ Berlin Meetup 0415
PDF
Advanced debugging
PPTX
Concurrency with side-effects – cats way
PPTX
Demystifying functional effect systems in Scala
PPTX
React hooks
PPTX
Writing testable code
PDF
Java - Singleton Pattern
PDF
Static Analysis of Context Leaks in Android Applications
Ansible Galaxy @ Berlin Meetup 0415
Advanced debugging
Concurrency with side-effects – cats way
Demystifying functional effect systems in Scala
React hooks
Writing testable code
Java - Singleton Pattern
Static Analysis of Context Leaks in Android Applications

What's hot (20)

PPTX
Fork Join
PDF
Fork Join (BeJUG 2012)
PPT
Template Method Design Pattern
ODP
How to add Fixtures into your Django app with Mixer
PPT
Template Method Pattern
PDF
The Mayans Lost Guide to RxJava on Android
PPTX
Каково состояние реактивного доступа к базам данных? Олег Докука и Игорь Лози...
PDF
Rx java workshop
PDF
Java input Scanner
PDF
Why on Earth would I test if I have to just "Let it crash"?
PPTX
Singleton Pattern (Sole Object with Global Access)
PPTX
React Hooks
PPTX
Angular 2.0 change detection
PPTX
TestNG vs JUnit: cease fire or the end of the war
PDF
Java Repetiotion Statements
PPTX
Headless fragments in Android
PPTX
Meetup - Singleton & DI/IoC
PDF
Unit testing in xcode 8 with swift
PPTX
Multiprocessing.pptx
PPTX
Reactive Programming on Android - RxAndroid - RxJava
Fork Join
Fork Join (BeJUG 2012)
Template Method Design Pattern
How to add Fixtures into your Django app with Mixer
Template Method Pattern
The Mayans Lost Guide to RxJava on Android
Каково состояние реактивного доступа к базам данных? Олег Докука и Игорь Лози...
Rx java workshop
Java input Scanner
Why on Earth would I test if I have to just "Let it crash"?
Singleton Pattern (Sole Object with Global Access)
React Hooks
Angular 2.0 change detection
TestNG vs JUnit: cease fire or the end of the war
Java Repetiotion Statements
Headless fragments in Android
Meetup - Singleton & DI/IoC
Unit testing in xcode 8 with swift
Multiprocessing.pptx
Reactive Programming on Android - RxAndroid - RxJava
Ad

Viewers also liked (9)

PDF
Scala Magic, Alexander Podhaliusin
PDF
The Kotlin Programming Language, Svetlana Isakova
PPTX
Types by Adform Research, Saulius Valatka
PPTX
Spark Intro by Adform Research
PDF
Cake pattern. Presentation by Alex Famin at scalaby#14
PDF
Работа с Akka Сluster, @afiskon, scalaby#14
PPTX
Testing in Scala by Adform research
PDF
scala.reflect, Eugene Burmako
PDF
a million bots can't be wrong
Scala Magic, Alexander Podhaliusin
The Kotlin Programming Language, Svetlana Isakova
Types by Adform Research, Saulius Valatka
Spark Intro by Adform Research
Cake pattern. Presentation by Alex Famin at scalaby#14
Работа с Akka Сluster, @afiskon, scalaby#14
Testing in Scala by Adform research
scala.reflect, Eugene Burmako
a million bots can't be wrong
Ad

Similar to Scala laboratory: Globus. iteration #3 (20)

PDF
Akka lsug skills matter
PDF
Scaling Web Apps with Akka
PPTX
Concurrency in Scala - the Akka way
PPTX
Introduction to Akka - Atlanta Java Users Group
ODP
Meetup slides
PDF
Akka-intro-training-public.pdf
PDF
Akka Actors: an Introduction
PDF
Introducing Akka
PDF
Introducing Akka
PDF
Introducingakkajavazone2012 120914094033-phpapp02
PPTX
Oop2011 actor presentation_stal
PDF
Actor-based concurrency in a modern Java Enterprise
PDF
Introduction to concurrent programming with akka actors
PDF
Introduction to concurrent programming with Akka actors
KEY
Akka london scala_user_group
PDF
Akka (1)
PPTX
Akka Actors
PDF
PDF
Dive into Akka Actors
PPTX
Akka framework
Akka lsug skills matter
Scaling Web Apps with Akka
Concurrency in Scala - the Akka way
Introduction to Akka - Atlanta Java Users Group
Meetup slides
Akka-intro-training-public.pdf
Akka Actors: an Introduction
Introducing Akka
Introducing Akka
Introducingakkajavazone2012 120914094033-phpapp02
Oop2011 actor presentation_stal
Actor-based concurrency in a modern Java Enterprise
Introduction to concurrent programming with akka actors
Introduction to concurrent programming with Akka actors
Akka london scala_user_group
Akka (1)
Akka Actors
Dive into Akka Actors
Akka framework

More from Vasil Remeniuk (20)

PPTX
Product Minsk - РТБ и Программатик
PPTX
Types by Adform Research
PPTX
Scalding by Adform Research, Alex Gryzlov
PPTX
Scalding by Adform Research, Alex Gryzlov
PPTX
Spark by Adform Research, Paulius
PPTX
Scala Style by Adform Research (Saulius Valatka)
PPTX
Spark intro by Adform Research
PPTX
SBT by Aform Research, Saulius Valatka
PDF
Scala laboratory: Globus. iteration #2
PPTX
Testing in Scala. Adform Research
PDF
Scala laboratory. Globus. iteration #1
PDF
Cassandra + Spark + Elk
PDF
Опыт использования Spark, Основано на реальных событиях
PDF
ETL со Spark
PDF
Funtional Reactive Programming with Examples in Scala + GWT
PDF
Vaadin+Scala
PDF
[Не]практичные типы
PPTX
Зачем нужна Scala?
PDF
Metaprogramming in Scala 2.10, Eugene Burmako,
PDF
"Scala in Goozy", Alexey Zlobin
Product Minsk - РТБ и Программатик
Types by Adform Research
Scalding by Adform Research, Alex Gryzlov
Scalding by Adform Research, Alex Gryzlov
Spark by Adform Research, Paulius
Scala Style by Adform Research (Saulius Valatka)
Spark intro by Adform Research
SBT by Aform Research, Saulius Valatka
Scala laboratory: Globus. iteration #2
Testing in Scala. Adform Research
Scala laboratory. Globus. iteration #1
Cassandra + Spark + Elk
Опыт использования Spark, Основано на реальных событиях
ETL со Spark
Funtional Reactive Programming with Examples in Scala + GWT
Vaadin+Scala
[Не]практичные типы
Зачем нужна Scala?
Metaprogramming in Scala 2.10, Eugene Burmako,
"Scala in Goozy", Alexey Zlobin

Recently uploaded (20)

PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Complications of Minimal Access Surgery at WLH
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Cell Types and Its function , kingdom of life
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Institutional Correction lecture only . . .
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
Pre independence Education in Inndia.pdf
PDF
01-Introduction-to-Information-Management.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Anesthesia in Laparoscopic Surgery in India
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
STATICS OF THE RIGID BODIES Hibbelers.pdf
Complications of Minimal Access Surgery at WLH
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
O7-L3 Supply Chain Operations - ICLT Program
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPH.pptx obstetrics and gynecology in nursing
Cell Types and Its function , kingdom of life
Microbial disease of the cardiovascular and lymphatic systems
Renaissance Architecture: A Journey from Faith to Humanism
Institutional Correction lecture only . . .
2.FourierTransform-ShortQuestionswithAnswers.pdf
Cell Structure & Organelles in detailed.
Pre independence Education in Inndia.pdf
01-Introduction-to-Information-Management.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx

Scala laboratory: Globus. iteration #3