/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit/Middleware/InterceptFilter.cs
35 строк
931 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.Threading.Tasks; /// <summary> /// Intercepts the pipe and executes an adjacent pipe prior to executing the next filter in the main pipe /// </summary> /// <typeparam name="TContext"></typeparam> public class InterceptFilter<TContext> : IFilter<TContext> where TContext : class, PipeContext { readonly IPipe<TContext> _pipe; public InterceptFilter(IPipe<TContext> pipe) { _pipe = pipe; } async Task IFilter<TContext>.Send(TContext context, IPipe<TContext> next) { await _pipe.Send(context).ConfigureAwait(false); await next.Send(context).ConfigureAwait(false); } void IProbeSite.Probe(ProbeContext context) { var scope = context.CreateFilterScope("wiretap"); _pipe.Probe(scope); } } }