Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG - @manumeyer1 22.09.2016...

38
Manuel Meyer | Trivadis AG www.manuelmeyer.net - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Transcript of Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG - @manumeyer1 22.09.2016...

Page 1: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Manuel Meyer | Trivadis AG

www.manuelmeyer.net - @manumeyer1

22.09.2016

Concurrent WPF mit Akka.NET

Page 2: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Über mich

• Consultant & Trainer für .NET

bei der Trivadis AG

• MVP für Visual Studio

• C# / XAML, Integration, Azure,

Troubleshooting & Performance

Management

Manuel Meyerhttp://manuelmeyer.net

@manumeyer1

Page 3: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Agenda

• History

• The Actor Model

• Akka.NET Principles

• Demo

Page 4: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Agenda

• History

• The Actor Model

• Akka.NET Principles

• Demo

Page 5: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET
Page 6: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Erlang

• Parallel

• Highly Available

• Fault-Tolerant

• Hot-Pluggable

• > COPL

• > Build MSSRTS.

Page 7: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Erlang

Prolog

Smalltalk

PLEX

F#

Clojure

Rust

Scala

Opa

Reia

Elixir

Dart

Akka

Page 8: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Erlang QuickSort

Page 9: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Erlang

Page 10: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Erlang Users

CouchDB

RabbitMQ

SimpleDB (AWS)

Cowboy, Ranch, Bullet, Sheriff

ejabberd

Page 11: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Akka.NET

Page 12: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Agenda

• History

• The Actor Model

• Akka.NET Principles

• Demo

Page 13: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

The Actor Model

• Dr. Carl Hewitt (MIT) 1973

“A Mathematical

Model of concurrent

computation”

Page 14: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

The Actor Model

• „in the prospect of highly parallel computing machines

with thousands of processors“

• Great fit for:

– Cloud

– Internet

– Mobile

– IoT

– Reactive

Page 15: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Actor Model

Page 16: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Actor Model

Page 17: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Actor Model

Actor = (Computation, Storage, Communication)

Page 18: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Demo:

Akka.NET

Page 19: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Agenda

• History

• The Actor Model

• Akka.NET Principles

• Demo

Page 20: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Akka Principles

• Everything is an Actor/Shared Nothing/Lightweight

Actors

• Distributed by Default/Divide and Conquer

• Fault Tolerance/Supervision/Error-Kernel Pattern

• Loose Coupling/Location Transparency/Dynamics.

Page 21: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Akka Principles

• Everything is an Actor/Shared Nothing/Lightweight

Actors

• Distributed by Default/Divide and Conquer

• Fault Tolerance/Supervision/Error-Kernel Pattern

• Loose Coupling/Location Transparency/Dynamics

Page 22: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Shared Nothing / Lightweight Actors

Actor System

Actors

Props

Factories

Messages (POCO)

ActorSystem.Create("MyActorSystem");

Page 23: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Shared Nothing / Lightweight Actors

• 3 Mio. Actors per GB of RAM

• Passive Actors.

Page 24: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Akka Principles

• Everything is an Actor/Shared Nothing/Lightweight

Actors

• Distributed by Default/Divide and Conquer

• Fault Tolerance/Supervision/Error-Kernel Pattern

• Loose Coupling/Location Transparency/Dynamics

Page 25: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Distributed by Default / Divide & Conquer

1. Take a huge pile of work

2. Break it down until it is easy to deal with

3. Respond as needed.

Page 26: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Akka Principles

• Everything is an Actor/Shared Nothing/Lightweight

Actors

• Distributed by Default/Divide and Conquer

• Fault Tolerance/Supervision/Error-Kernel Pattern

• Loose Coupling/Location Transparency/Dynamics

Page 27: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET
Page 28: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET
Page 29: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Source: Petabridge Bootcamp

Page 30: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Fault Tolerance / Error Kernel Pattern

Page 31: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Akka Principles

• Everything is an Actor/Shared Nothing/Lightweight

Actors

• Distributed by Default/Divide and Conquer

• Fault Tolerance/Supervision/Error-Kernel Pattern

• Loose Coupling/Location Transparency/Dynamics

Page 32: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Loose Coupling / Location Transparency

IActorReference:

ActorPath:

akka.tcp://MyActorSystem@LTMME:9001/user/actorName1

Page 33: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Agenda

• History

• The Actor Model

• Akka.NET Principles

• Demo

Page 34: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Demo

• Read CPU Data continuously

• Perform Calculations

• Give Data to Viewmodel

Page 35: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

CPUReadActor

ChartingActorCoordinationActor

ActorSystem

WPFCreate()

Page 36: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

CPUReadActor ChartingActor

CoordinationActor

ActorSystem

ReadCPURequest

DataMessage

DrawPointMessage

Page 37: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Resources

• Akka.NET

– http://getakka.net

• Petabridge Akka.NET Bootcamp

– https://petabridge.com/bootcamp/

• Pluralsight (www.pluralsight.com)

– Akka.NET Fundamentals

– WPF, SPA, REST

Page 38: Concurrent WPF mit Akka - manuelmeyer.net · Manuel Meyer | Trivadis AG  - @manumeyer1 22.09.2016 Concurrent WPF mit Akka.NET

Manuel Meyer | Trivadis AG

www.manuelmeyer.net

@manumeyer1

Concurrent WPF mit Akka.NET