/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit/JobService/IJobDistributionStrategy.cs
21 строка
867 B
Chris Patterson
Added new job distribution strategy support, with job options including job/instance properties that can be used by the strategy to allocate job slots. Also added global concurrent job limit across all instances (optional).
03 окт 2024, 21:39
03 окт 2024, 21:39
4eddf3e
Код
Авторство
О чём код?
#nullable enable namespace MassTransit; using System.Threading.Tasks; using Contracts.JobService; /// <summary> /// Used by the <see cref="JobTypeStateMachine" /> to determine if a job slot should be allocated to a job /// </summary> public interface IJobDistributionStrategy { /// <summary> /// Determine if a job slot is available and return an <see cref="ActiveJob"/> instance if the job can be assigned to a job consumer instance. /// If no instance is available or the concurrency limits would be exceeded, return null. /// </summary> /// <param name="context"></param> /// <param name="jobTypeInfo"></param> /// <returns>An <see cref="ActiveJob"/> if the job can be assigned to a job consumer instance, or null</returns> Task<ActiveJob?> IsJobSlotAvailable(ConsumeContext<AllocateJobSlot> context, JobTypeInfo jobTypeInfo); }