using System; using System.Threading.Tasks; using Abp.Threading.BackgroundWorkers; namespace Abp.BackgroundJobs { //TODO: Create a non-generic EnqueueAsync extension method to IBackgroundJobManager which takes types as input parameters rather than generic parameters. /// /// Defines interface of a job manager. /// public interface IBackgroundJobManager : IBackgroundWorker { /// /// Enqueues a job to be executed. /// /// Type of the job. /// Type of the arguments of job. /// Job arguments. /// Job priority. /// Job delay (wait duration before first try). /// Unique identifier of a background job. Task EnqueueAsync(TArgs args, BackgroundJobPriority priority = BackgroundJobPriority.Normal, TimeSpan? delay = null) where TJob : IBackgroundJob; /// /// Deletes a job with the specified jobId. /// /// The Job Unique Identifier. /// True on a successfull state transition, false otherwise. Task DeleteAsync(string jobId); } }