private void EnsureFabricOrchestrationProviderIsInitialized() { if (this.fabricOrchestrationProvider == null) { this.fabricOrchestrationProvider = this.fabricProviderFactory.CreateProvider(); } }
async Task StopAsync() { try { if (this.worker != null) { ServiceFabricProviderEventSource.Tracing.LogFabricServiceInformation(this.statefulService, "Stopping Taskhub Worker"); await this.worker.StopAsync(isForced : true); this.worker.Dispose(); this.worker = null; this.fabricOrchestrationProvider.Dispose(); this.fabricOrchestrationProvider = null; ServiceFabricProviderEventSource.Tracing.LogFabricServiceInformation(this.statefulService, "Stopped Taskhub Worker"); } } catch (Exception e) { ServiceFabricProviderEventSource.Tracing.ServiceRequestFailed("Exception when Stopping Worker On Primary Stop", e.ToString()); throw; } }
public Startup(string listeningAddress, FabricOrchestrationProvider fabricOrchestrationProvider) { this.listeningAddress = listeningAddress ?? throw new ArgumentNullException(nameof(listeningAddress)); this.fabricOrchestrationProvider = fabricOrchestrationProvider ?? throw new ArgumentNullException(nameof(fabricOrchestrationProvider)); }