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
|
||||
{
|
||||
|
||||
}
|
||||
24
Source/ProofOfConcept/Services/MQTTServer.cs
Normal file
24
Source/ProofOfConcept/Services/MQTTServer.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
{
|
||||
|
||||
}
|
||||
24
Source/ProofOfConcept/Services/MessageProcessor.cs
Normal file
24
Source/ProofOfConcept/Services/MessageProcessor.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace ProofOfConcept.Services;
|
||||
|
||||
public class MessageProcessor
|
||||
{
|
||||
private ILogger<MessageProcessor> logger;
|
||||
private MessageProcessorConfiguration configuration;
|
||||
|
||||
public MessageProcessor(ILogger<MessageProcessor> logger, IOptionsMonitor<MessageProcessorConfiguration> options)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.configuration = options.CurrentValue;
|
||||
|
||||
options.OnChange(newValue =>
|
||||
{
|
||||
this.configuration = newValue;
|
||||
logger.LogInformation("Configuration of {ClassName} changed", nameof(MessageProcessor));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class MessageProcessorConfiguration
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user