continuity/Server/PacketConsumer.cs

18 lines
426 B
C#
Raw Normal View History

2023-08-09 14:23:41 +00:00
using MassTransit;
namespace Server;
public class PacketConsumer : IConsumer<Packet>
{
private readonly PacketDistributorService _distributorService;
public PacketConsumer(PacketDistributorService distributorService)
{
_distributorService = distributorService;
}
public Task Consume(ConsumeContext<Packet> context)
{
return _distributorService.AddPacket(context.Message);
}
}