24 lines
593 B
C#
24 lines
593 B
C#
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
|
|
{
|
|
|
|
} |