/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit/Middleware/FutureRequestPipe.cs
35 строк
936 B
Chris Patterson
Integration of all external packages into MassTransit, split out into Abstractions, Middleware, and the core MassTransit assembly.
22 янв 2022, 18:24
22 янв 2022, 18:24
b5b4f50
Код
Авторство
О чём код?
namespace MassTransit.Middleware { using System; using System.Threading.Tasks; public class FutureRequestPipe<T> : IPipe<SendContext<T>> where T : class { readonly IPipe<SendContext<T>> _pipe; readonly Guid _requestId; readonly Uri _responseAddress; public FutureRequestPipe(IPipe<SendContext<T>> pipe, Uri responseAddress, Guid requestId) { _pipe = pipe; _responseAddress = responseAddress; _requestId = requestId; } public Task Send(SendContext<T> context) { context.ResponseAddress = _responseAddress; context.RequestId = _requestId; return _pipe.IsNotEmpty() ? _pipe.Send(context) : Task.CompletedTask; } public void Probe(ProbeContext context) { context.CreateFilterScope(nameof(FutureRequestPipe<T>)); } } }