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; }
static void Main(string[] args) { ActorSystem actorSystem = ActorSystem.Create("mainActorSystem"); actorSystem.ActorOf(BuyerBuilderActor.Create(), "buyerBuilder"); actorSystem.ActorOf(SellerBuilderActor.Create(), "sellerBuilder"); actorSystem.ActorOf(ConsoleWriterActor.Create(), "consoleWriter"); actorSystem.ActorOf(InputParserActor.Create(), "inputParser"); IActorRef consoleReader = actorSystem.ActorOf(ConsoleReaderActor.Create(), "consoleReader"); consoleReader.Tell(ConsoleReaderActor.ReadCommand); actorSystem.WhenTerminated.Wait(); }