static void Main(string[] args) { using (var actorSystem = ActorSystem.Create("simulator")) { var firstProj = Guid.NewGuid(); var secondProj = Guid.NewGuid(); var notifierProps = Props.Create(() => new SimulationNotifierActor()); var systemActors = new SystemActors(actorSystem) { SimulationNotifier = actorSystem.ActorOf(notifierProps) }; var props = Props.Create(() => new CoordinatorActor(systemActors)); var coordinatorActor = actorSystem.ActorOf(props, "SimulationCoordinator"); var coActorSelection = actorSystem.ActorSelection("akka.tcp://TechnologyA@localhost:8091/user/coordinator"); coActorSelection.Tell(new StartSimulation()); actorSystem.WhenTerminated.Wait(); Console.ReadLine(); } }
static void Main(string[] args) { var url = "http://+:12345"; using (var actorSystem = ActorSystem.Create("CoolSystem")) { var app = WebHost.CreateDefaultBuilder(args) .ConfigureServices((services) => { var sa = new SystemActors() { HealthCheckActor = actorSystem.ActorOf(HealthCheckActor.Props(), "healthCheck"), FooCoordinatorActor = actorSystem.ActorOf(FooCoordinatorActor.Props(), "fooCoordinator"), BarActor = actorSystem.ActorOf(BarActor.Props(), "bar") }; services.AddSingleton(sa); }) .UseStartup <Startup>() .UseUrls(url) .Build(); app.Run(); } }
public TraitLocationAttribute(SystemActors systemActors) { SystemActors = systemActors; }
public FooBarController(SystemActors systemActors) { _systemActors = systemActors; }
public ActorInfo this[SystemActors key] => dict[key.ToString().ToLowerInvariant()];
public HealthCheck(SystemActors systemActors) { _systemActors = systemActors; }