You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
749 B

  1. using JT808.Gateway.Abstractions;
  2. using JT808.Gateway.InMemoryMQ.Services;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace JT808.Gateway.InMemoryMQ
  8. {
  9. public class JT808MsgProducer : IJT808MsgProducer
  10. {
  11. private readonly JT808MsgService JT808MsgService;
  12. public string TopicName => JT808GatewayConstants.MsgTopic;
  13. public JT808MsgProducer(JT808MsgService jT808MsgService)
  14. {
  15. JT808MsgService = jT808MsgService;
  16. }
  17. public async ValueTask ProduceAsync(string terminalNo, byte[] data)
  18. {
  19. await JT808MsgService.WriteAsync(terminalNo, data);
  20. }
  21. public void Dispose()
  22. {
  23. }
  24. }
  25. }