using System; using Abp.Threading; namespace Abp.BackgroundJobs { /// /// Some extension methods for . /// public static class BackgroundJobManagerExtensions { /// /// Enqueues a job to be executed. /// /// Type of the job. /// Type of the arguments of job. /// Background job manager reference /// Job arguments. /// Job priority. /// Job delay (wait duration before first try). public static void Enqueue(this IBackgroundJobManager backgroundJobManager, TArgs args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, TimeSpan? delay = null) where TJob : IBackgroundJob { AsyncHelper.RunSync(() => backgroundJobManager.EnqueueAsync(args, priority, delay)); } } }