24 lines
593 B
C#
24 lines
593 B
C#
namespace ProofOfConcept.Services;
|
|
|
|
public class MQTTServer
|
|
{
|
|
private ILogger<MQTTServer> logger;
|
|
private MQTTServerConfiguration configuration;
|
|
|
|
public MQTTServer(ILogger<MQTTServer> logger, IOptionsMonitor<MQTTServerConfiguration> options)
|
|
{
|
|
this.logger = logger;
|
|
this.configuration = options.CurrentValue;
|
|
|
|
options.OnChange(newValue =>
|
|
{
|
|
this.configuration = newValue;
|
|
logger.LogInformation("Configuration of {ClassName} changed", nameof(MQTTServer));
|
|
});
|
|
}
|
|
}
|
|
|
|
public class MQTTServerConfiguration
|
|
{
|
|
|
|
} |