jellyfin-server/MediaBrowser.Common/ScheduledTasks/ITaskManager.cs

77 lines
2.4 KiB
C#
Raw Normal View History

2014-05-08 20:09:53 +00:00
using MediaBrowser.Model.Events;
2013-03-07 05:34:00 +00:00
using System;
2013-02-23 07:57:11 +00:00
using System.Collections.Generic;
2013-03-07 05:34:00 +00:00
using System.Threading.Tasks;
2013-02-23 07:57:11 +00:00
namespace MediaBrowser.Common.ScheduledTasks
{
public interface ITaskManager : IDisposable
{
/// <summary>
/// Gets the list of Scheduled Tasks
/// </summary>
/// <value>The scheduled tasks.</value>
IScheduledTaskWorker[] ScheduledTasks { get; }
2013-02-23 07:57:11 +00:00
/// <summary>
/// Cancels if running and queue.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="options">Task options.</param>
2015-03-07 17:19:44 +00:00
void CancelIfRunningAndQueue<T>(TaskExecutionOptions options)
where T : IScheduledTask;
/// <summary>
/// Cancels if running and queue.
/// </summary>
/// <typeparam name="T"></typeparam>
void CancelIfRunningAndQueue<T>()
2013-02-23 07:57:11 +00:00
where T : IScheduledTask;
2013-09-23 18:53:06 +00:00
/// <summary>
/// Cancels if running.
/// </summary>
/// <typeparam name="T"></typeparam>
void CancelIfRunning<T>()
where T : IScheduledTask;
2013-02-23 07:57:11 +00:00
/// <summary>
/// Queues the scheduled task.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="options">Task options.</param>
2015-03-07 17:19:44 +00:00
void QueueScheduledTask<T>(TaskExecutionOptions options)
where T : IScheduledTask;
/// <summary>
/// Queues the scheduled task.
/// </summary>
/// <typeparam name="T"></typeparam>
void QueueScheduledTask<T>()
2013-02-23 07:57:11 +00:00
where T : IScheduledTask;
/// <summary>
/// Queues the scheduled task.
/// </summary>
/// <param name="task">The task.</param>
/// <param name="options">The task run options.</param>
void QueueScheduledTask(IScheduledTask task, TaskExecutionOptions options = null);
2013-02-23 07:57:11 +00:00
/// <summary>
/// Adds the tasks.
/// </summary>
/// <param name="tasks">The tasks.</param>
void AddTasks(IEnumerable<IScheduledTask> tasks);
2013-03-07 05:34:00 +00:00
void Cancel(IScheduledTaskWorker task);
Task Execute(IScheduledTaskWorker task, TaskExecutionOptions options = null);
2013-03-07 05:34:00 +00:00
2016-02-03 20:52:45 +00:00
void Execute<T>()
where T : IScheduledTask;
2014-05-10 17:28:03 +00:00
event EventHandler<GenericEventArgs<IScheduledTaskWorker>> TaskExecuting;
event EventHandler<TaskCompletionEventArgs> TaskCompleted;
2016-02-03 20:52:45 +00:00
bool SuspendTriggers { get; set; }
2013-02-23 07:57:11 +00:00
}
}