18 lines
492 B
C#
18 lines
492 B
C#
namespace Server.Consumers;
|
|
|
|
using MassTransit;
|
|
using Packets;
|
|
using Services;
|
|
|
|
public class PacketConsumer : IConsumer<RawPacket>
|
|
{
|
|
private readonly PacketDistributorService distributorService;
|
|
|
|
public PacketConsumer(PacketDistributorService distributorService) => this.distributorService = distributorService;
|
|
|
|
public Task Consume(ConsumeContext<RawPacket> context)
|
|
{
|
|
this.distributorService.AddPacket(context.Message);
|
|
return Task.CompletedTask;
|
|
}
|
|
}
|