Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

36 lines
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. }