async process on worker of AddRectangle

This commit is contained in:
2026-02-16 16:56:00 +01:00
parent d9caeb2209
commit 1750f5adb1
12 changed files with 107 additions and 9 deletions

View File

@@ -0,0 +1,6 @@
using AipsCore.Application.Abstract.MessageBroking;
using AipsCore.Application.Models.Shape.Command.CreateRectangle;
namespace AipsCore.Application.Common.Message.AddRectangle;
public record AddRectangleMessage(CreateRectangleCommand Command) : IMessage;

View File

@@ -0,0 +1,19 @@
using AipsCore.Application.Abstract;
using AipsCore.Application.Abstract.MessageBroking;
namespace AipsCore.Application.Common.Message.AddRectangle;
public class AddRectangleMessageHandler : IMessageHandler<AddRectangleMessage>
{
private readonly IDispatcher _dispatcher;
public AddRectangleMessageHandler(IDispatcher dispatcher)
{
_dispatcher = dispatcher;
}
public async Task Handle(AddRectangleMessage message, CancellationToken cancellationToken)
{
await _dispatcher.Execute(message.Command, cancellationToken);
}
}