2019-04-24 16:04:30 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti.Transient
|
|
|
|
|
{
|
|
|
|
|
public class TransientPublisher : ITransientPublisher
|
|
|
|
|
{
|
|
|
|
|
private readonly TransientRouter router;
|
2019-04-25 13:19:51 +00:00
|
|
|
|
private readonly IPublisher publisher;
|
2019-04-24 16:04:30 +00:00
|
|
|
|
|
2019-04-25 13:19:51 +00:00
|
|
|
|
public TransientPublisher(TransientRouter router, IPublisher publisher)
|
2019-04-24 16:04:30 +00:00
|
|
|
|
{
|
|
|
|
|
this.router = router;
|
2019-04-25 13:19:51 +00:00
|
|
|
|
this.publisher = publisher;
|
2019-04-24 16:04:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<TResponse> RequestResponse<TRequest, TResponse>(TRequest request)
|
|
|
|
|
{
|
2019-04-25 13:19:51 +00:00
|
|
|
|
return (TResponse)(await router.RequestResponse(publisher, request));
|
2019-04-24 16:04:30 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|