feat: create request projects for basic CQRS
This commit is contained in:
commit
d614788e06
190 changed files with 12236 additions and 0 deletions
20
src/request.dispatcher/IScalarRequestHandler.cs
Normal file
20
src/request.dispatcher/IScalarRequestHandler.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) The Geekeey Authors
|
||||
// SPDX-License-Identifier: EUPL-1.2
|
||||
|
||||
namespace Geekeey.Request.Dispatcher;
|
||||
|
||||
/// <summary>
|
||||
/// Defines a handler for processing requests of a specific type and returning a response.
|
||||
/// </summary>
|
||||
/// <typeparam name="TRequest">The type of the request to be handled. Must implement <see cref="IScalarRequest{TResponse}"/>.</typeparam>
|
||||
/// <typeparam name="TResponse">The type of the response produced by the implementing request handler.</typeparam>
|
||||
public interface IScalarRequestHandler<in TRequest, TResponse> where TRequest : IScalarRequest<TResponse>
|
||||
{
|
||||
/// <summary>
|
||||
/// Processes a scalar request and returns a response asynchronously.
|
||||
/// </summary>
|
||||
/// <param name="request">The request object to be processed.</param>
|
||||
/// <param name="cancellationToken">A token to observe for cancellation requests.</param>
|
||||
/// <returns>A task representing the asynchronous operation, containing the response of type <typeparamref name="TResponse"/>.</returns>
|
||||
Task<TResponse> HandleAsync(TRequest request, CancellationToken cancellationToken = default);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue