Remove Configure() from ITelemetryPublisher
This commit is contained in:
parent
38f5edbe2b
commit
2d4d3c347d
4 changed files with 3 additions and 12 deletions
|
@ -9,7 +9,6 @@ namespace NucuCar.Domain.Telemetry
|
|||
{
|
||||
void Start();
|
||||
Task StartAsync();
|
||||
void Configure(Dictionary<string, object> config);
|
||||
bool RegisterTelemeter(ITelemeter t);
|
||||
bool UnRegisterTelemeter(ITelemeter t);
|
||||
Task PublishAsync(CancellationToken cancellationToken);
|
||||
|
|
|
@ -22,8 +22,6 @@ namespace NucuCar.Domain.Telemetry
|
|||
public abstract Task StartAsync();
|
||||
public abstract bool Publish(int timeout);
|
||||
public abstract Task PublishAsync(CancellationToken cancellationToken);
|
||||
public abstract void Configure(Dictionary<string, object> config);
|
||||
|
||||
public bool RegisterTelemeter(ITelemeter t)
|
||||
{
|
||||
if (RegisteredTelemeters.Contains(t)) return false;
|
||||
|
|
|
@ -29,10 +29,6 @@ namespace NucuCar.Domain.Telemetry
|
|||
}
|
||||
Logger.LogInformation("Started the AzureTelemetryPublisher!");
|
||||
}
|
||||
public override void Configure(Dictionary<string, object> config)
|
||||
{
|
||||
ConnectionString = config.GetValueOrDefault("AzureIotHubConnectionString").ToString();
|
||||
}
|
||||
|
||||
public override async Task PublishAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -34,10 +34,8 @@ namespace NucuCar.Sensors.Telemetry
|
|||
using var telemetryService = TelemetryPublisher.Instance;
|
||||
|
||||
telemetryService.Logger = _logger;
|
||||
telemetryService.Configure(new Dictionary<string, object>()
|
||||
{
|
||||
["AzureIotHubConnectionString"] = _azureIotHubConnectionString
|
||||
});
|
||||
telemetryService.ConnectionString = _azureIotHubConnectionString;
|
||||
telemetryService.TelemetrySource = "NucuCar.Sensors";
|
||||
|
||||
telemetryService.Start();
|
||||
while (!stoppingToken.IsCancellationRequested)
|
||||
|
|
Loading…
Reference in a new issue