/// <summary> /// Finds workers that are not running and removes them from the collection of active workers, so that new ones can be made to replace them /// </summary> private void WorkerHealthCheck() { while (true) { try { if (ShutdownEvent.IsSet) { return; } _actorManager.PruneInactiveWorkers(); if (WorkerSubscriptionEnded.IsSet) { // If our composer's subscription to worker reports has fallen over, stand it back up SubscribeToWorkerReports(); } // Dumb 30 second long sleep Thread.Sleep(30 * 1000); } catch (Exception ex) { OnErrorAction(ex); } } }