You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Services/Shedulling/IExpirationAsyncSheduller.cs

35 lines
1.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Threading.Tasks;
namespace ZeroLevel.Services.Shedulling
{
public interface IExpirationAsyncSheduller : IDisposable
{
/// <summary>
/// Добавление задачи с указанием времени по истечении которого она должна быть исполнена
/// </summary>
long Push(TimeSpan timespan, Func<long, Task> callback);
/// <summary>
/// Добавление задачи с указанием даты/времени когда она должна быть исполнена
/// </summary>
long Push(DateTime date, Func<long, Task> callback);
/// <summary>
/// Удаляет событие по его идентификатору
/// </summary>
/// <param name="key">Идентификатор события</param>
bool Remove(long key);
/// <summary>
/// Очистка планировщика
/// </summary>
void Clean();
/// <summary>
/// Приостановка работы планировщика (не препятствует добавлению новых заданий)
/// </summary>
void Pause();
/// <summary>
/// Возобновление работы планировщика
/// </summary>
void Resume();
}
}

Powered by TurnKey Linux.