Date post: | 05-Aug-2015 |
Category: |
Software |
Upload: | betclic-everest-group-tech-team |
View: | 770 times |
Download: | 1 times |
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
_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, // maxNumberOfRetriesTimeSpan.FromSeconds(30), // durationx =>{
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
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);
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
About Us• Betclic Everest Group, one of the world leaders in online
gaming, has a unique portfolio comprising variouscomplementary international brands: Betclic, EverestPoker/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 ourstrategy to deliver an on-line gaming offer attuned to thepassion of our players. We want our brands to be easy to usefor every gamer around the world. We’re building ourcompany to make that happen.
• Active in 100 countries with more than 12 million customersworldwide, the Group is committed to promoting secure andresponsible gaming and is a member of several internationalprofessional associations including the EGBA (EuropeanGaming and Betting Association) and the ESSA (EuropeanSports Security Association).
We want our Sports betting, Poker, Horse racing andCasino & Games brands to be easy to use for everygamer around the world. Code with us to make thathappen.
Look at all the challenges we offer HERE
Check our Employer Page
Follow us on LinkedIn
WE’RE HIRING !