2025-06-04 09:42:48 +08:00

15 lines
413 B
C#

using Microsoft.Extensions.Hosting;
namespace Seyounth.Auto.Hs.Runtime.Plc;
public class PlcBackgroundService(IPlcService plc) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
await plc.QueryWarningInfo();
await Task.Delay(50, stoppingToken);
}
}
}