Created
February 12, 2018 15:26
-
-
Save alexandrebl/10459d7348e12787b7c2daf49af88e09 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Akka.Actor; | |
| namespace akkat1 { | |
| internal class Program { | |
| private static void Main() { | |
| var actorSystem = ActorSystem.Create("IDGActorSystem"); | |
| var basicActor = actorSystem.ActorOf<ConsoleActor>(); | |
| basicActor.Tell("Initialized"); | |
| Console.ReadLine(); | |
| } | |
| } | |
| public class ConsoleActor : UntypedActor { | |
| public ConsoleActor() { | |
| Console.ForegroundColor = ConsoleColor.Cyan; | |
| } | |
| protected override void OnReceive(object message) { | |
| if (message is string) { | |
| Console.WriteLine($"{DateTime.UtcNow:o}: {message}"); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment