public void BindIsland(Config config) { string systemName = config.GetString("akka.remote.system-name"); string hostname = config.GetString("akka.remote.dot-netty.tcp.hostname"); string port = config.GetString("akka.remote.system-port"); //var selection = Context.ActorSelection("akka.tcp://[email protected]:2552/user/actorName"); var hostActorPath = $"akka.tcp://{systemName}@{hostname}:{port}/user/island-router"; ActorSelection selection = Context.ActorSelection(hostActorPath); try { IslandProvider = selection.ResolveOne(TimeSpan.FromSeconds(3)).Result; //IslandProvider.Tell(new Identify(_guid), Self); IslandProvider.Tell(new BindIslandMessage(), Self); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"Island {Self.Path} binded to host {IslandProvider.Path.ToStringWithoutAddress()}"); Console.ForegroundColor = ConsoleColor.White; } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"Bind error to {hostActorPath} \n {ex.Message}"); Console.ForegroundColor = ConsoleColor.White; } }
/// <summary> /// Сформирована новая популяция для миграции /// </summary> /// <param name="migration"></param> private void OnMigrationReady(IEnumerable <IChromosome> migration) { IslandProvider.Tell(new MigrateSolutionsMessage(migration)); }