1
0
mirror of synced 2024-12-22 17:23:07 +01:00
Tapeti/Tapeti.Transient/TransientPublisher.cs
Mark van Renswoude a0c9d97694 Added ConfigureAwait to (hopefully) all awaits
Ugly as heck, but it's recommended for libraries
2024-04-08 14:20:15 +02:00

30 lines
835 B
C#

using System.Threading.Tasks;
namespace Tapeti.Transient
{
/// <summary>
/// Default implementation of ITransientPublisher
/// </summary>
internal class TransientPublisher : ITransientPublisher
{
private readonly TransientRouter router;
private readonly IPublisher publisher;
/// <summary>
/// </summary>
public TransientPublisher(TransientRouter router, IPublisher publisher)
{
this.router = router;
this.publisher = publisher;
}
/// <inheritdoc />
public async Task<TResponse> RequestResponse<TRequest, TResponse>(TRequest request) where TRequest : class where TResponse : class
{
return (TResponse)await router.RequestResponse(publisher, request).ConfigureAwait(false);
}
}
}