DD.WellWorkover.Cloud/AsbCloudApp/Services/IBackgroundWorkerService.cs

22 lines
837 B
C#
Raw Normal View History

2022-04-11 18:00:34 +05:00
using System;
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudApp.Services
{
public interface IBackgroundWorkerService
{
bool Contains(string id);
/// <summary>
/// Добавляет в очередь задач новую задачу
/// </summary>
/// <param name="id">id задачи в очереди</param>
/// <param name="func">делегат</param>
/// <returns>id задачи в очереди</returns>
string Enqueue(string id, Func<string, CancellationToken, Task> func);
string Enqueue(Func<string, CancellationToken, Task> func);
string Enqueue(string id, Func<string, CancellationToken, Task> func, Func<string, Exception, CancellationToken, Task> onError);
bool TryRemove(string id);
}
}