using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Volo.Abp.BackgroundJobs
{
///
/// Defines interface to store/get background jobs.
///
public interface IBackgroundJobStore
{
///
/// Gets a BackgroundJobInfo based on the given jobId.
///
/// The Job Unique Identifier.
/// The BackgroundJobInfo object.
Task FindAsync(Guid jobId);
///
/// Inserts a background job.
///
/// Job information.
Task InsertAsync(BackgroundJobInfo jobInfo);
///
/// Gets waiting jobs. It should get jobs based on these:
/// Conditions: !IsAbandoned And NextTryTime <= Clock.Now.
/// Order by: Priority DESC, TryCount ASC, NextTryTime ASC.
/// Maximum result: .
///
/// Maximum result count.
Task> GetWaitingJobsAsync(int maxResultCount);
///
/// Deletes a job.
///
/// The Job Unique Identifier.
Task DeleteAsync(Guid jobId);
///
/// Updates a job.
///
/// Job information.
Task UpdateAsync(BackgroundJobInfo jobInfo);
}
}