continuity/Server/PacketConsumer.cs
2023-08-09 16:23:41 +02:00

18 lines
No EOL
426 B
C#

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);
}
}