private static async Task Main() { _sysactor = ActorSystem.Create("theSystem"); var vehicles = _sysactor.ActorOf <VehiclesActor>("vehicles"); var writer = _sysactor.ActorOf <ConsoleWriterActor>("writer"); var commander = _sysactor.ActorOf(CommandActor.Props(vehicles, writer), "commander"); _sysactor.ActorOf(ConsoleReaderActor.Props(commander), "reader"); commander.Tell("print"); await _sysactor.WhenTerminated; }
public static void Main() { var system = ActorSystem.Create("TreasureHunter"); var list = new List <IActorRef>(); var commander = system.ActorOf(CommandActor.Props(list), "Commander"); var account = system.ActorOf(AccountMonitor.Props(commander), "Account"); account.Tell(new ScheduleMessage()); do { Console.Write("botmgr > "); string inputText = Console.ReadLine(); if (!string.IsNullOrEmpty(inputText)) { commander.Tell(new UserCommandMessage() { Text = inputText }); } } while (true); }