WHAT'S NEW?
Loading...

Akka.Net fundamentals - conference by Andrew Skotzo

Concurrency


Since almost 10 years, computers almost don't increase their CPU speed. That's why manufacturers started creating multi core computers. Microsoft started releasing multi threading libraries like TPL (.Net 4.0), async/await (.Net 4.5), so developers could use the different cores in the new CPU's.

Concurrency is hard (complicate to code: deadlocks, livelocks....), there's a lot of stuff you need to manage in order to have a stable concurrent system working properly.

What Akka.Net brings is a handy messaging system which help us to abstracts the communication between our components so we don't need to worry about how to manage concurrency in our app.

The real benefit of Akka.Net is that if your application runs in a local machine like your development environment, it can run directly in a cloud farm without performing any change in your solution.

Actors

Properties
  • Actor runs on threads
  • Actors processes messages one by one.
  • Actors are lazy and simple
  • Core abilities:
    • send messages
    • create other actors
    • change behaviour

  • Location transparency: it doesn't matter where the actors are as long as I know their address to call them.
Mailbox
  • message queue to communicate with your actors

Behaviour
  • Switcheable behavior: owned by one instance of one actor. It can be modified at any time with a single method call.

State
  • all messages in aka are unmutable (the state never changes)

SupervisorStrategy
  • Hierarchies: Actors live in hierarchies. Every actor has a parent and can be a parent. Parents are supervisors so they can manage what's wrong with one of their sons and never bubble up the issue.

Children
  • This is how looks the hierarchy in akka: /user/a1/c1. User is the parent, a1 would be the son and c1 the grandson.

Reactive manifesto
  • Responsive
  • Resilient
  • Message driven
  • Elastic

Where can I use Akka?

  • Analytic systems
  • Marketing automation
  • Multiplayer games
  • Devices / IoT traking
  • Alerting monitoring systems
  • Recommendation engines
  • Dynamic pricing
  • Reactive UI

Bootcamp

I really recommend you to finish this bootcamp provided by Mr. Andrew Skotzo. It will give you a really good understanding about how to build your first application using Akka.net by creating a small application with a couple of Actors which communicate between them meanwhile hearing your entries through the console.

https://gist.github.com/skotzko/de23e02aa71a6817aa09

References

http://getakka.net/docs/Getting%20started

0 comments:

Post a Comment