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

36 行
953B

  1. using HealthMonitor.Service.Resolver;
  2. using HealthMonitor.Service.Resolver.Interface;
  3. using Microsoft.Extensions.Logging;
  4. using System;
  5. using System.Collections.Concurrent;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace HealthMonitor.Service.Sub
  11. {
  12. public class MsgQueueManager: ConcurrentQueue<PackageMsgModel>
  13. {
  14. private readonly ILogger<MsgQueueManager> _logger;
  15. private readonly BloodpressResolver _resolver;
  16. public MsgQueueManager(ILogger<MsgQueueManager> logger, BloodpressResolver resolver)
  17. {
  18. _logger = logger;
  19. _resolver = resolver;
  20. }
  21. public IResolver? GetMsgResolver()
  22. {
  23. TryDequeue(out var msg);
  24. if (msg == null)
  25. {
  26. return null;
  27. }
  28. _resolver.SetResolveInfo(msg);
  29. return _resolver;
  30. }
  31. }
  32. }