Initial commit
This commit is contained in:
24
Source/ProofOfConcept/Services/MQTTClient.cs
Normal file
24
Source/ProofOfConcept/Services/MQTTClient.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace ProofOfConcept.Services;
|
||||
|
||||
public class MQTTClient
|
||||
{
|
||||
private ILogger<MQTTClient> logger;
|
||||
private MQTTClientConfiguration configuration;
|
||||
|
||||
public MQTTClient(ILogger<MQTTClient> logger, IOptionsMonitor<MQTTClientConfiguration> options)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.configuration = options.CurrentValue;
|
||||
|
||||
options.OnChange(newValue =>
|
||||
{
|
||||
this.configuration = newValue;
|
||||
logger.LogInformation("Configuration of {ClassName} changed", nameof(MQTTClient));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class MQTTClientConfiguration
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user