private static bool Handler(CtrlType sig) { Console.WriteLine("Exiting system due to external CTRL-C, or process kill, or shutdown"); //do your cleanup here ClusterHelper.Tell(new ClusterHelper.RemoveMember()); Thread.Sleep(5000); // Give the Remove time to actually remove... ClusterSystem.Terminate(); Console.WriteLine("Cleanup complete"); //shutdown right away so there are no lingering threads Environment.Exit(-1); return(true); }
public void Clusterize(List <ResearchObject> researchObjects) { _clusterSystem = new ClusterSystem(InitialClustering(researchObjects)); _dendrogram = new Dendrogram(); foreach (var cluster in _clusterSystem.Clusters.Values) { _dendrogram.AddNode(cluster); } CalculateSearchArea(); while (_clusterSystem.Clusters.Count > 1) { PerformClusteringStep(); } }
public override void PostStart() { Console.WriteLine($"PostStart: {ServiceName} running..."); ClusterSystem.ActorOf(Props.Create <PoisonActor>(), "poison-actor"); }