18 lines
426 B
C#
18 lines
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);
|
|||
|
}
|
|||
|
}
|