/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit.Abstractions/SagaStateMachine/IBehavior.cs
78 строк
3 KB
Chris Patterson
Huge push towards optimization on startup, state machines, type discovery, caching, and the consume pipeline. Rebuilt the dispatch filter as a consume context filter for message type dispatch.
27 мар 2024, 02:43
27 мар 2024, 02:43
c17b1de
Код
Авторство
О чём код?
namespace MassTransit { using System; using System.Threading.Tasks; /// <summary> /// A behavior is a chain of activities invoked by a state /// </summary> /// <typeparam name="TInstance">The state type</typeparam> public interface IBehavior<TInstance> : IVisitable where TInstance : class, SagaStateMachineInstance { /// <summary> /// Execute the activity with the given behavior context /// </summary> /// <param name="context">The behavior context</param> /// <returns>An awaitable task</returns> Task Execute(BehaviorContext<TInstance> context); /// <summary> /// Execute the activity with the given behavior context /// </summary> /// <param name="context">The behavior context</param> /// <returns>An awaitable task</returns> Task Execute<T>(BehaviorContext<TInstance, T> context) where T : class; /// <summary> /// The exception path through the behavior allows activities to catch and handle exceptions /// </summary> /// <typeparam name="T"></typeparam> /// <typeparam name="TException"></typeparam> /// <param name="context"></param> /// <returns></returns> Task Faulted<T, TException>(BehaviorExceptionContext<TInstance, T, TException> context) where T : class where TException : Exception; /// <summary> /// The exception path through the behavior allows activities to catch and handle exceptions /// </summary> /// <typeparam name="TException"></typeparam> /// <param name="context"></param> /// <returns></returns> Task Faulted<TException>(BehaviorExceptionContext<TInstance, TException> context) where TException : Exception; } /// <summary> /// A behavior is a chain of activities invoked by a state /// </summary> /// <typeparam name="TSaga">The state type</typeparam> /// <typeparam name="TMessage">The data type of the behavior</typeparam> public interface IBehavior<TSaga, in TMessage> : IVisitable where TSaga : class, SagaStateMachineInstance where TMessage : class { /// <summary> /// Execute the activity with the given behavior context /// </summary> /// <param name="context">The behavior context</param> /// <returns>An awaitable task</returns> Task Execute(BehaviorContext<TSaga, TMessage> context); /// <summary> /// The exception path through the behavior allows activities to catch and handle exceptions /// </summary> /// <typeparam name="TException"></typeparam> /// <param name="context"></param> /// <returns></returns> Task Faulted<TException>(BehaviorExceptionContext<TSaga, TMessage, TException> context) where TException : Exception; } }