Interface IChaparRequestClient<TRequest, TResponse>
Abstraction for request/response messaging pattern.
The client is specialised for one request‑response pair and is typically
registered in the DI container for a specific TRequest.
Namespace: Chapar.Core.Abstractions
Assembly: Chapar.Core.dll
Syntax
public interface IChaparRequestClient<TRequest, TResponse> where TRequest : class, IMessage
Type Parameters
| Name | Description |
|---|---|
| TRequest | The type of the outgoing request (must implement IMessage). |
| TResponse | The type of the expected response (any serializable type). |
Methods
| Edit this page View SourceGetResponseAsync(TRequest, CancellationToken)
Sends a request and waits for the corresponding response.
Declaration
Task<TResponse> GetResponseAsync(TRequest request, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TRequest | request | The request payload. |
| CancellationToken | cancellationToken | Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<TResponse> | The response message. |