public ClusterContext(ICluster cluster, CancellationTokenSource tokenSource, ClusterOptions options) { Cluster = cluster; ClusterOptions = options; _tokenSource = tokenSource; // Register this instance of ClusterContext options.AddClusterService(this); ServiceProvider = options.BuildServiceProvider(); _logger = ServiceProvider.GetRequiredService <ILogger <ClusterContext> >(); _redactor = ServiceProvider.GetRequiredService <IRedactor>(); _configHandler = ServiceProvider.GetRequiredService <IConfigHandler>(); _clusterNodeFactory = ServiceProvider.GetRequiredService <IClusterNodeFactory>(); }