+ All Categories
Home > Technology > What is the actor model

What is the actor model

Date post: 13-Apr-2017
Category:
Upload: william-brander
View: 252 times
Download: 0 times
Share this document with a friend
15
William Brander What is the Actor Model? A glance using Akka.NET Tools & Frameworks
Transcript
Page 1: What is the actor model

William BranderWhat is the Actor Model? A glance using Akka.NET

Tools & Frameworks

Page 2: What is the actor model

>What is The Actor Model

>Intro to Akka.NET

>What to do when things go wrong

Agenda

Page 3: What is the actor model

But first… a concurrency recap

$50$70

Current balance: $70

Request $50Check Balance

Balance GoodBalance Good Current

balance: $20Request $70 Check BalanceBalance Bad

Balance Bad

Request $50Check Balance

Request $70Balance Good

Check BalanceBalance Good

Balance Good Current balance: $20

Balance Good

Current balance: -$50

Concurrency is hard

Page 4: What is the actor model

Demo: Flawed concurrent processing

Page 5: What is the actor model

Concurrency is hard>Code loses intent>It’s even harder across application boundaries>Are there situations you’ve missed?

>And how many of you noticed that the code was wrong?

if (CanDraw(amount)){ if (CanDraw(amount)) { lock (_lock) { ///... } }}

lock (_lock){ if (CanDraw(amount)) {

if (CanDraw(amount)) { ///... } }}

Page 6: What is the actor model

The Actor Model

Behaviour Concurrency State Mailbox

Page 7: What is the actor model

The Actor Model>Actors are objects that operate concurrently>Actors maintain their own state>Actors communicate via message passing>Actors have behaviour>Actors have an address but not a location

Page 8: What is the actor model

Demo: Akka.NET

Page 9: What is the actor model

Akka.NET>.NET port of Akka>Handles concurrency, messaging, and location

transparency>At most once delivery

Page 10: What is the actor model

Is the network reliable?>Well sure. Mostly. Sometimes.>It is, until it’s not.The network is NOT

reliableAnd neither is your

application code

Page 11: What is the actor model

Demo: Presenting a fallacy

Page 12: What is the actor model

Things go wrong>What’s important is to never lose messages

>Supervisors can monitor for failures

>Embrace the Dead Letter Queue

Page 13: What is the actor model

Alternatives>Orleans>Akka>Remact.Net

>Other Patterns?• Process Control

Page 14: What is the actor model

Suggested reading>http://www.enterpriseintegrationpatterns.com/

>Why has the Actor Model not succeeded?

>Finding Service Boundaries (video)

>Dr. Harvey and the 8 Fallacies of Distributed Computing (http://bit.ly/WBZAdev)

>Udi Dahan’s Advanced Distributed Systems Design Course (http://go.particular.net/SA2016, code: 1yC70)

Page 15: What is the actor model

/* THANK YOU*/William BranderParticular [email protected]@WilliamBZA

http://www.devconf.co.za/


Recommended