books/backend/Books.Api/Infrastructure/IScheduler.cs

12 lines
400 B
C#
Raw Normal View History

using System.Linq.Expressions;
namespace Books.Api.Infrastructure;
public interface IScheduler
{
void EnqueueJob<T>(Expression<Func<T, Task>> methodCall);
void EnqueueJob<T>(Expression<Func<T, Task>> methodCall, TimeSpan delay);
void EnqueueJob(Expression<Func<Task>> methodCall);
void AddOrUpdateScheduledJob<T>(string title, Expression<Func<T?, Task>> methodCall, string cron);
}