aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Tasks/ITaskManager.cs
diff options
context:
space:
mode:
authorAndrew Rabert <ar@nullsum.net>2018-12-27 18:27:57 -0500
committerAndrew Rabert <ar@nullsum.net>2018-12-27 18:27:57 -0500
commita86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 (patch)
treea74f6ea4a8abfa1664a605d31d48bc38245ccf58 /MediaBrowser.Model/Tasks/ITaskManager.cs
parent9bac3ac616b01f67db98381feb09d34ebe821f9a (diff)
Add GPL modules
Diffstat (limited to 'MediaBrowser.Model/Tasks/ITaskManager.cs')
-rw-r--r--MediaBrowser.Model/Tasks/ITaskManager.cs78
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..cbc18032c
--- /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>(TaskOptions 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>(TaskOptions 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>
+ void QueueScheduledTask(IScheduledTask task, TaskOptions options);
+
+ /// <summary>
+ /// Adds the tasks.
+ /// </summary>
+ /// <param name="tasks">The tasks.</param>
+ void AddTasks(IEnumerable<IScheduledTask> tasks);
+
+ void Cancel(IScheduledTaskWorker task);
+ Task Execute(IScheduledTaskWorker task, TaskOptions options);
+
+ void Execute<T>()
+ where T : IScheduledTask;
+
+ event EventHandler<GenericEventArgs<IScheduledTaskWorker>> TaskExecuting;
+ event EventHandler<TaskCompletionEventArgs> TaskCompleted;
+
+ void RunTaskOnNextStartup(string key);
+ }
+} \ No newline at end of file