Skip to content

Instantly share code, notes, and snippets.

@alexandrebl
Created February 12, 2018 15:26
Show Gist options
  • Select an option

  • Save alexandrebl/10459d7348e12787b7c2daf49af88e09 to your computer and use it in GitHub Desktop.

Select an option

Save alexandrebl/10459d7348e12787b7c2daf49af88e09 to your computer and use it in GitHub Desktop.
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