/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit/Configuration/CircuitBreakerConfigurationExtensions.cs
29 строк
1017 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 { using System; using Configuration; public static class CircuitBreakerConfigurationExtensions { /// <summary> /// Puts a circuit breaker in the pipe, which can automatically prevent the flow of messages to the consumer /// when the circuit breaker is opened. /// </summary> /// <typeparam name="T">The pipe context type</typeparam> /// <param name="configurator"></param> /// <param name="configure"></param> public static void UseCircuitBreaker<T>(this IPipeConfigurator<T> configurator, Action<ICircuitBreakerConfigurator<T>> configure = null) where T : class, PipeContext { if (configurator == null) throw new ArgumentNullException(nameof(configurator)); var specification = new CircuitBreakerPipeSpecification<T>(); configure?.Invoke(specification); configurator.AddPipeSpecification(specification); } } }