protected AnimalCassandraFactory(string keyspace, ILogger logger, IConsulService consulService) { var contactPoint = consulService.Get("Hosts/Cassandra/Host").GetAwaiter().GetResult(); var contactPort = consulService.Get("Hosts/Cassandra/Port").GetAwaiter().GetResult(); int portNumber; if (!int.TryParse(contactPort, out portNumber)) { throw new InvalidOperationException("Cassndra's port number is not valid."); } var stopWatch = Stopwatch.StartNew(); cluster = Cluster.Builder() .AddContactPoints(contactPoint.Split(',').Where(x => !string.IsNullOrWhiteSpace(x))) .WithPort(portNumber) .WithCompression(CompressionType.Snappy) .Build(); Session = cluster.Connect(keyspace); stopWatch.Stop(); logger.Debug(null, $"CassandraProvider.ctor('{keyspace}') ⌚{stopWatch.ElapsedMilliseconds}ms").GetAwaiter() .GetResult(); Logger = logger; this.consulService = consulService; Task.Run(PrepareStatements).GetAwaiter().GetResult(); }
public ConsulServicesRegistry(IConsulService consulService) { _consulService = consulService; }
public AnimalController(IConsulService consulService, IMediator mediator) { _mediator = mediator; }
public App(IConsulService consulService, ILogger <App> logger) { this.consulService = consulService; this.logger = logger; }
public MessageSender(IBusFactory busFactory, IConsulService consulService, IContractInitializationService contractInitializationService) { this.busFactory = busFactory; this.consulService = consulService; this.contractInitializationService = contractInitializationService; }
public ValuesController(IConsulService consulService) { _consulService = consulService; }
public AnimalDbContextFactory(IConsulService consuleService) { _connectionString = consuleService.Get("ConnectionString").GetAwaiter().GetResult(); }
public SettingsStore(IConsulService consulService) { this.consulService = consulService; }