您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

6 个月前
6 个月前
12345678910111213141516171819202122232425262728
  1. using Microsoft.Extensions.Logging;
  2. using TelpoPush.Worker.ThirdSsl.Handlers;
  3. namespace TelpoPush.Worker.ThirdSsl
  4. {
  5. public class Worker : BackgroundService
  6. {
  7. private readonly IHostEnvironment _env;
  8. private readonly ILogger<Worker> _logger;
  9. KafkaSubscribe _kafkaSubscribe;
  10. public Worker(ILogger<Worker> logger, IHostEnvironment env, KafkaSubscribe kafkaSubscribe)
  11. {
  12. _env = env;
  13. _logger = logger;
  14. _kafkaSubscribe = kafkaSubscribe;
  15. }
  16. protected override async Task ExecuteAsync(CancellationToken stoppingToken)
  17. {
  18. while (!stoppingToken.IsCancellationRequested)
  19. {
  20. await _kafkaSubscribe.SubscribeAsync();
  21. //await Task.Delay(30000, stoppingToken);
  22. }
  23. }
  24. }
  25. }