/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit/Middleware/ScopedFilter.cs
32 строки
876 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; using DependencyInjection; public class ScopedFilter<TContext> : IFilter<TContext> where TContext : class, PipeContext { readonly IFilterScopeProvider<TContext> _scopeProvider; public ScopedFilter(IFilterScopeProvider<TContext> scopeProvider) { _scopeProvider = scopeProvider; } public async Task Send(TContext context, IPipe<TContext> next) { await using IFilterScopeContext<TContext> scope = _scopeProvider.Create(context); await scope.Filter.Send(scope.Context, next).ConfigureAwait(false); } public void Probe(ProbeContext context) { var scope = context.CreateFilterScope("scopedFilter"); _scopeProvider.Probe(scope); } } }