forked from ddrilling/AsbCloudServer
22 lines
837 B
C#
22 lines
837 B
C#
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);
|
|
}
|
|
} |