際際滷

際際滷Share a Scribd company logo
H辰ndelsestyrda system med

Akka
Actors
Johan Andr辿n
johan.andren@mejsla.se
Moores lag
2,6 miljarder

1 miljon

2300

1971

1990

idag
No Problems!
Oh No, Problems!







Race conditions
Korrupt data
Deadlocks
Thread contention
Livelocks
Priority Inversion
Multitr奪dning 辰r SVRT





Att skriva
Att testa
Att debugga
Att resonera kring

Vi beh旦ver en b辰ttre modell!
Akka   frukostseminarium
B

C

D

A

F

E
h辰ndelsestyrda

system med

ACTORS
Akka   frukostseminarium
Tillst奪nd

Inkorg

Enda s辰ttet att
interagera

Beteende






Entr奪dsmodell - l辰tt att f旦rst奪
Inget delat tillst奪nd
L辰ttviktig
L旦s koppling
L辰tt att testa
Actor A

Actor B
Env辰gskommunikation
Actor A

Actor B
Reagera, inte v辰nta
Actor A

Actor B
Lastbalansera
Actor A

Actor B1
router

Actor B2
Pipe/Filter
Actor A

Actor F
(filter)

Actor B
Parallellisera
Actor C1

Actor A

Actor B
(chef)

Actor C2

Actor C2




Inget jobb, ingen tr奪d!
Async - aldrig v辰nta aktivt p奪 svar
L旦s koppling
JVM

B

C

D

A

F

E
JVM 1

B

C

JVM 2

D

A

F

E
Ingen skillnad p奪





Tv奪 actors p奪 en k辰rna, en i taget
Tv奪 actors p奪 en k辰rna, samtidigt
Tv奪 actors p奪 varsin k辰rna
Tv奪 actors p奪 varsin server
Felhantering

i Actorsystem
Akka   frukostseminarium
Traditionell modell




L辰ckage mellan skikt
Uppt辰cka samtidiga fel
Hur veta hur ett fel skall hanteras?
Felhantering med Actors
(f旦r辰lder)

Actor A

Actor X

Actor Z
Felhantering med Actors
(f旦r辰lder)

Actor A

Actor X

Actor Z
Felhantering med Actors
Actor A

Actor X

Actor Z
Supervision



Vattent辰ta skott
Explicit vad som kommuniceras
tillbaka



Separation av felhantering och



M旦jligt att hantera samtidiga fel

aff辰rslogik
Och mer!






STM
Remoting
Klustring utan SPoF
Integration med MQs
Eventbus

http://akka.io
Recap





Enkel men extremt kraftfull modell
L辰ttviktigt och snabbt
L旦s koppling
Sj辰lvl辰kande system

Johan Andr辿n
johan.andren@mejsla.se

More Related Content

More from Johan Andr辿n (20)

Next generation message driven systems with Akka
Next generation message driven systems with AkkaNext generation message driven systems with Akka
Next generation message driven systems with Akka
Johan Andr辿n
Buiilding reactive distributed systems with Akka
Buiilding reactive distributed systems with AkkaBuiilding reactive distributed systems with Akka
Buiilding reactive distributed systems with Akka
Johan Andr辿n
Next generation actors with Akka
Next generation actors with AkkaNext generation actors with Akka
Next generation actors with Akka
Johan Andr辿n
Next generation message driven systems with Akka
Next generation message driven systems with AkkaNext generation message driven systems with Akka
Next generation message driven systems with Akka
Johan Andr辿n
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams
Johan Andr辿n
Networks and types - the future of Akka
Networks and types - the future of AkkaNetworks and types - the future of Akka
Networks and types - the future of Akka
Johan Andr辿n
Reactive streams processing using Akka Streams
Reactive streams processing using Akka StreamsReactive streams processing using Akka Streams
Reactive streams processing using Akka Streams
Johan Andr辿n
Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Building reactive distributed systems with Akka
Building reactive distributed systems with Akka
Johan Andr辿n
Akka streams - Umea java usergroup
Akka streams - Umea java usergroupAkka streams - Umea java usergroup
Akka streams - Umea java usergroup
Johan Andr辿n
Streaming all the things with akka streams
Streaming all the things with akka streams   Streaming all the things with akka streams
Streaming all the things with akka streams
Johan Andr辿n
Asynchronous stream processing with Akka Streams
Asynchronous stream processing with Akka StreamsAsynchronous stream processing with Akka Streams
Asynchronous stream processing with Akka Streams
Johan Andr辿n
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsScala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streams
Johan Andr辿n
VJUG24 - Reactive Integrations with Akka Streams
VJUG24  - Reactive Integrations with Akka StreamsVJUG24  - Reactive Integrations with Akka Streams
VJUG24 - Reactive Integrations with Akka Streams
Johan Andr辿n
Introduction to akka actors with java 8
Introduction to akka actors with java 8Introduction to akka actors with java 8
Introduction to akka actors with java 8
Johan Andr辿n
Async - react, don't wait - PingConf
Async - react, don't wait - PingConfAsync - react, don't wait - PingConf
Async - react, don't wait - PingConf
Johan Andr辿n
Scala frukostseminarium
Scala frukostseminariumScala frukostseminarium
Scala frukostseminarium
Johan Andr辿n
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to Akka
Johan Andr辿n
Async react, don't wait
Async  react, don't waitAsync  react, don't wait
Async react, don't wait
Johan Andr辿n
Macros and reflection in scala 2.10
Macros and reflection in scala 2.10Macros and reflection in scala 2.10
Macros and reflection in scala 2.10
Johan Andr辿n
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
Johan Andr辿n
Next generation message driven systems with Akka
Next generation message driven systems with AkkaNext generation message driven systems with Akka
Next generation message driven systems with Akka
Johan Andr辿n
Buiilding reactive distributed systems with Akka
Buiilding reactive distributed systems with AkkaBuiilding reactive distributed systems with Akka
Buiilding reactive distributed systems with Akka
Johan Andr辿n
Next generation actors with Akka
Next generation actors with AkkaNext generation actors with Akka
Next generation actors with Akka
Johan Andr辿n
Next generation message driven systems with Akka
Next generation message driven systems with AkkaNext generation message driven systems with Akka
Next generation message driven systems with Akka
Johan Andr辿n
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams
Johan Andr辿n
Networks and types - the future of Akka
Networks and types - the future of AkkaNetworks and types - the future of Akka
Networks and types - the future of Akka
Johan Andr辿n
Reactive streams processing using Akka Streams
Reactive streams processing using Akka StreamsReactive streams processing using Akka Streams
Reactive streams processing using Akka Streams
Johan Andr辿n
Building reactive distributed systems with Akka
Building reactive distributed systems with Akka Building reactive distributed systems with Akka
Building reactive distributed systems with Akka
Johan Andr辿n
Akka streams - Umea java usergroup
Akka streams - Umea java usergroupAkka streams - Umea java usergroup
Akka streams - Umea java usergroup
Johan Andr辿n
Streaming all the things with akka streams
Streaming all the things with akka streams   Streaming all the things with akka streams
Streaming all the things with akka streams
Johan Andr辿n
Asynchronous stream processing with Akka Streams
Asynchronous stream processing with Akka StreamsAsynchronous stream processing with Akka Streams
Asynchronous stream processing with Akka Streams
Johan Andr辿n
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsScala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streams
Johan Andr辿n
VJUG24 - Reactive Integrations with Akka Streams
VJUG24  - Reactive Integrations with Akka StreamsVJUG24  - Reactive Integrations with Akka Streams
VJUG24 - Reactive Integrations with Akka Streams
Johan Andr辿n
Introduction to akka actors with java 8
Introduction to akka actors with java 8Introduction to akka actors with java 8
Introduction to akka actors with java 8
Johan Andr辿n
Async - react, don't wait - PingConf
Async - react, don't wait - PingConfAsync - react, don't wait - PingConf
Async - react, don't wait - PingConf
Johan Andr辿n
Scala frukostseminarium
Scala frukostseminariumScala frukostseminarium
Scala frukostseminarium
Johan Andr辿n
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to Akka
Johan Andr辿n
Async react, don't wait
Async  react, don't waitAsync  react, don't wait
Async react, don't wait
Johan Andr辿n
Macros and reflection in scala 2.10
Macros and reflection in scala 2.10Macros and reflection in scala 2.10
Macros and reflection in scala 2.10
Johan Andr辿n
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
Johan Andr辿n

Akka frukostseminarium