protected override void OnReceive(object message) { message.Match().With<TimeSpan>( d => { Thread.Sleep(d); Sender.Tell("done"); }) .With<string>(s => { if (s.Equals("echo")) Sender.Tell("reply"); }); } }