Akka.NET
class ConsoleWriterActor : UntypedActor
{
protected override void OnReceive(object message)
{
if (message is Messages.InputError)
{
var msg = message as Messages.InputError;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(msg.Reason);
}
else
{
Console.WriteLine(message);
}
Console.ResetColor();
}
}
System = ActorSystem.Create("MyActorSystem");
var props = Props.Create<ConsoleWriterActor>();
var actor = System.ActorOf(props, "consoleWriterActor");
Creating the system & an actor
Messages are POCOs
Message-passing is asynchronous
Messages are immutable
actor.Tell("message");
Sending a message
Nothing more 
_consoleWriterActor.Tell(new Messages.NullInputError());
Sender.Tell(new Messages.ContinueProcessing());
Context.ActorSelection("akka://MyActorSystem/user/tailCoordinatorActor")
.Tell(new TailCoordinatorActor.StartTail(msg, _consoleWriterActor));
Communication between actors
protected override SupervisorStrategy SupervisorStrategy()
{
return new OneForOneStrategy(
10, // maxNumberOfRetries
TimeSpan.FromSeconds(30), // duration
x =>
{
if (x is ApplicationException)
return Directive.Escalate;
if (x is ArithmeticException)
return Directive.Resume;
if (x is NotSupportedException)
return Directive.Stop;
return Directive.Restart;
});
}
Supervision strategy
Asynchronous system
.WithDispatcher("akka.actor.synchronized-dispatcher")
Routers
Actors pool
Blocking actors
var getStarrer = _gitHubClient.Activity.Starring.GetAllForUser(starrer);
//ewww
getStarrer.Wait();
var starredRepos = getStarrer.Result;
Sender.Tell(new StarredReposForUser(starrer, starredRepos));
Async inside an actor
var sender = Sender;
var getStarrer = _gitHubClient.Activity.Starring.GetAllForUser(starrer);
getStarrer.ContinueWith<StarredReposForUser>(res =>
{
var starredRepos = getStarrer.Result;
return new StarredReposForUser(starrer, starredRepos
}).PipeTo(sender);
Plugins
Akka.Remote
Akka.Cluster
Akka.Persistence
Akka.TestKit
Yes, it scales
Resources
• http://getakka.net/
• https://github.com/akkadotnet/akka.net
• https://github.com/petabridge/akkadotnet-code-
samples
• https://petabridge.com/bootcamp/
• https://www.youtube.com/c/PetabridgeAcademy
25
Find out more
• On https://techblog.betclicgroup.com/
About Us
• Betclic Everest Group, one of the world leaders in online
gaming, has a unique portfolio comprising various
complementary international brands: Betclic, Everest
Poker/Casino, Bet-at-home, Expekt, Imperial Casino, Monte-
Carlo Casino…
• Through our brands, Betclic Everest Group places expertise,
technological know-how and security at the heart of our
strategy to deliver an on-line gaming offer attuned to the
passion of our players. We want our brands to be easy to use
for every gamer around the world. We’re building our
company to make that happen.
• Active in 100 countries with more than 12 million customers
worldwide, the Group is committed to promoting secure and
responsible gaming and is a member of several international
professional associations including the EGBA (European
Gaming and Betting Association) and the ESSA (European
Sports Security Association).
We want our Sports betting, Poker, Horse racing and
Casino & Games brands to be easy to use for every
gamer around the world. Code with us to make that
happen.
Look at all the challenges we offer HERE
Check our Employer Page
Follow us on LinkedIn
WE’RE HIRING !

Akka.Net