using Akka.Configuration;
public string Who { get;private set; }
public class CancelTimeOut
public class GreetingActor : ReceiveActor
private ICancelable cancel;
cancel = Context.System.Scheduler.ScheduleTellOnceCancelable( TimeSpan.FromSeconds(2), Self, new MyTimeOut(), Self);
Console.WriteLine("Hello {0} {1}", greet.Who, DateTime.Now);
Receive<MyTimeOut>( _ => Console.WriteLine("TimeOut"));
Receive<CancelTimeOut>( _ =>
Console.WriteLine("Cancel");
public static void Main()
var config = ConfigurationFactory.ParseString(@"akka.actor.default-dispatcher { type = ""Akka.Dispatch.TaskDispatcherConfigurator""}");
var system = ActorSystem.Create("Sample", config);
var greeter = system.ActorOf<GreetingActor>("greeter");
greeter.Tell(new Greet("World"));