/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit/Configuration/JobServiceConfigurationExtensions.cs
145 строк
8 KB
Chris Patterson
Removed Obsolete Property, added a bunch of obsolete attributes
10 авг 2023, 06:43
10 авг 2023, 06:43
15c44ca
Код
Авторство
О чём код?
namespace MassTransit { using System; using Configuration; public static class JobServiceConfigurationExtensions { /// <summary> /// Configures support for job consumers on the service instance, which supports executing long-running jobs without blocking the consumer pipeline. /// Job consumers use multiple state machines to track jobs, each of which runs on its own dedicated receive endpoint. Multiple service /// instances will use the competing consumer pattern, so a shared saga repository should be configured. /// </summary> /// <typeparam name="T">The transport receive endpoint configurator type</typeparam> /// <param name="configurator">The service instance</param> /// <param name="configure"></param> /// <param name="context"></param> [Obsolete("Use AddJobSagaStateMachines instead. Visit https://masstransit.io/obsolete for details.")] public static IServiceInstanceConfigurator<T> ConfigureJobServiceEndpoints<T>(this IServiceInstanceConfigurator<T> configurator, IRegistrationContext context, Action<IJobServiceConfigurator> configure = default) where T : IReceiveEndpointConfigurator { var jobServiceConfigurator = new JobServiceConfigurator<T>(configurator); configure?.Invoke(jobServiceConfigurator); jobServiceConfigurator.ConfigureJobServiceEndpoints(context); return configurator; } /// <summary> /// Configures support for job consumers on the service instance, which supports executing long-running jobs without blocking the consumer pipeline. /// Job consumers use multiple state machines to track jobs, each of which runs on its own dedicated receive endpoint. Multiple service /// instances will use the competing consumer pattern, so a shared saga repository should be configured. /// </summary> /// <typeparam name="T">The transport receive endpoint configurator type</typeparam> /// <param name="configurator">The service instance</param> /// <param name="configure"></param> public static IServiceInstanceConfigurator<T> ConfigureJobServiceEndpoints<T>(this IServiceInstanceConfigurator<T> configurator, Action<IJobServiceConfigurator> configure = default) where T : IReceiveEndpointConfigurator { var jobServiceConfigurator = new JobServiceConfigurator<T>(configurator); configure?.Invoke(jobServiceConfigurator); jobServiceConfigurator.ConfigureJobServiceEndpoints(); return configurator; } /// <summary> /// Configures support for job consumers on the service instance, which supports executing long-running jobs without blocking the consumer pipeline. /// Job consumers use multiple state machines to track jobs, each of which runs on its own dedicated receive endpoint. Multiple service /// instances will use the competing consumer pattern, so a shared saga repository should be configured. /// </summary> /// <typeparam name="T">The transport receive endpoint configurator type</typeparam> /// <param name="configurator">The service instance</param> /// <param name="options"></param> /// <param name="context"></param> /// <param name="configure"></param> [Obsolete("Use AddJobSagaStateMachines instead. Visit https://masstransit.io/obsolete for details.")] public static IServiceInstanceConfigurator<T> ConfigureJobServiceEndpoints<T>(this IServiceInstanceConfigurator<T> configurator, JobServiceOptions options, IRegistrationContext context, Action<IJobServiceConfigurator> configure = default) where T : IReceiveEndpointConfigurator { var jobServiceConfigurator = new JobServiceConfigurator<T>(configurator, options); configure?.Invoke(jobServiceConfigurator); jobServiceConfigurator.ConfigureJobServiceEndpoints(context); return configurator; } /// <summary> /// Configures support for job consumers on the service instance, which supports executing long-running jobs without blocking the consumer pipeline. /// Job consumers use multiple state machines to track jobs, each of which runs on its own dedicated receive endpoint. Multiple service /// instances will use the competing consumer pattern, so a shared saga repository should be configured. /// </summary> /// <typeparam name="T">The transport receive endpoint configurator type</typeparam> /// <param name="configurator">The service instance</param> /// <param name="options"></param> /// <param name="configure"></param> [Obsolete("Use AddJobSagaStateMachines instead. Visit https://masstransit.io/obsolete for details.")] public static IServiceInstanceConfigurator<T> ConfigureJobServiceEndpoints<T>(this IServiceInstanceConfigurator<T> configurator, JobServiceOptions options, Action<IJobServiceConfigurator> configure = default) where T : IReceiveEndpointConfigurator { var jobServiceConfigurator = new JobServiceConfigurator<T>(configurator, options); configure?.Invoke(jobServiceConfigurator); jobServiceConfigurator.ConfigureJobServiceEndpoints(); return configurator; } /// <summary> /// Configures support for job consumers on the service instance, which supports executing long-running jobs without blocking the consumer pipeline. /// Job consumers use multiple state machines to track jobs, each of which runs on its own dedicated receive endpoint. Multiple service /// instances will use the competing consumer pattern, so a shared saga repository should be configured. /// This method does not configure the state machine endpoints required to use the job service, and should only be used for services where another /// service has the job service endpoints configured. /// </summary> /// <typeparam name="T">The transport receive endpoint configurator type</typeparam> /// <param name="configurator">The service instance</param> /// <param name="configure"></param> [Obsolete("Job Consumers no longer require a service instance. Visit https://masstransit.io/obsolete for details.")] public static IServiceInstanceConfigurator<T> ConfigureJobService<T>(this IServiceInstanceConfigurator<T> configurator, Action<IJobServiceConfigurator> configure = default) where T : IReceiveEndpointConfigurator { var jobServiceConfigurator = new JobServiceConfigurator<T>(configurator); configure?.Invoke(jobServiceConfigurator); return configurator; } /// <summary> /// Configures support for job consumers on the service instance, which supports executing long-running jobs without blocking the consumer pipeline. /// Job consumers use multiple state machines to track jobs, each of which runs on its own dedicated receive endpoint. Multiple service /// instances will use the competing consumer pattern, so a shared saga repository should be configured. /// This method does not configure the state machine endpoints required to use the job service, and should only be used for services where another /// service has the job service endpoints configured. /// </summary> /// <typeparam name="T">The transport receive endpoint configurator type</typeparam> /// <param name="configurator">The service instance</param> /// <param name="options"></param> /// <param name="configure"></param> [Obsolete("Job Consumers no longer require a service instance. Visit https://masstransit.io/obsolete for details.")] public static IServiceInstanceConfigurator<T> ConfigureJobService<T>(this IServiceInstanceConfigurator<T> configurator, JobServiceOptions options, Action<IJobServiceConfigurator> configure = default) where T : IReceiveEndpointConfigurator { var jobServiceConfigurator = new JobServiceConfigurator<T>(configurator, options); configure?.Invoke(jobServiceConfigurator); return configurator; } } }