diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-12-18 00:44:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-18 00:44:33 -0500 |
| commit | e7cebb91a73354dc3e0d0b6340c9fbd6511f4406 (patch) | |
| tree | 6f1c368c766c17b7514fe749c0e92e69cd89194a /MediaBrowser.Model/Tasks/ITaskManager.cs | |
| parent | 025905a3e4d50b9a2e07fbf4ff0a203af6604ced (diff) | |
| parent | aaa027f3229073e9a40756c3157d41af2a442922 (diff) | |
Merge pull request #2350 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Model/Tasks/ITaskManager.cs')
| -rw-r--r-- | MediaBrowser.Model/Tasks/ITaskManager.cs | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Tasks/ITaskManager.cs b/MediaBrowser.Model/Tasks/ITaskManager.cs new file mode 100644 index 000000000..fa3da97b3 --- /dev/null +++ b/MediaBrowser.Model/Tasks/ITaskManager.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using MediaBrowser.Model.Events; + +namespace MediaBrowser.Model.Tasks +{ + public interface ITaskManager : IDisposable + { + /// <summary> + /// Gets the list of Scheduled Tasks + /// </summary> + /// <value>The scheduled tasks.</value> + IScheduledTaskWorker[] ScheduledTasks { get; } + + /// <summary> + /// Cancels if running and queue. + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="options">Task options.</param> + void CancelIfRunningAndQueue<T>(TaskExecutionOptions options) + where T : IScheduledTask; + + /// <summary> + /// Cancels if running and queue. + /// </summary> + /// <typeparam name="T"></typeparam> + void CancelIfRunningAndQueue<T>() + where T : IScheduledTask; + + /// <summary> + /// Cancels if running. + /// </summary> + /// <typeparam name="T"></typeparam> + void CancelIfRunning<T>() + where T : IScheduledTask; + + /// <summary> + /// Queues the scheduled task. + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="options">Task options.</param> + void QueueScheduledTask<T>(TaskExecutionOptions options) + where T : IScheduledTask; + + /// <summary> + /// Queues the scheduled task. + /// </summary> + /// <typeparam name="T"></typeparam> + void QueueScheduledTask<T>() + where T : IScheduledTask; + + void QueueIfNotRunning<T>() + 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); + + /// <summary> + /// Adds the tasks. + /// </summary> + /// <param name="tasks">The tasks.</param> + void AddTasks(IEnumerable<IScheduledTask> tasks); + + void Cancel(IScheduledTaskWorker task); + Task Execute(IScheduledTaskWorker task, TaskExecutionOptions options = null); + + void Execute<T>() + where T : IScheduledTask; + + event EventHandler<GenericEventArgs<IScheduledTaskWorker>> TaskExecuting; + event EventHandler<TaskCompletionEventArgs> TaskCompleted; + } +}
\ No newline at end of file |
