aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/ScheduledTasks/IScheduledTaskWorker.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common/ScheduledTasks/IScheduledTaskWorker.cs')
-rw-r--r--MediaBrowser.Common/ScheduledTasks/IScheduledTaskWorker.cs86
1 files changed, 86 insertions, 0 deletions
diff --git a/MediaBrowser.Common/ScheduledTasks/IScheduledTaskWorker.cs b/MediaBrowser.Common/ScheduledTasks/IScheduledTaskWorker.cs
new file mode 100644
index 000000000..31cb4bcb8
--- /dev/null
+++ b/MediaBrowser.Common/ScheduledTasks/IScheduledTaskWorker.cs
@@ -0,0 +1,86 @@
+using MediaBrowser.Model.Tasks;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.Common.ScheduledTasks
+{
+ /// <summary>
+ /// Interface IScheduledTaskWorker
+ /// </summary>
+ public interface IScheduledTaskWorker : IDisposable
+ {
+ /// <summary>
+ /// Gets or sets the scheduled task.
+ /// </summary>
+ /// <value>The scheduled task.</value>
+ IScheduledTask ScheduledTask { get; }
+
+ /// <summary>
+ /// Gets the last execution result.
+ /// </summary>
+ /// <value>The last execution result.</value>
+ TaskResult LastExecutionResult { get; }
+
+ /// <summary>
+ /// Gets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ string Name { get; }
+
+ /// <summary>
+ /// Gets the description.
+ /// </summary>
+ /// <value>The description.</value>
+ string Description { get; }
+
+ /// <summary>
+ /// Gets the category.
+ /// </summary>
+ /// <value>The category.</value>
+ string Category { get; }
+
+ /// <summary>
+ /// Gets the state.
+ /// </summary>
+ /// <value>The state.</value>
+ TaskState State { get; }
+
+ /// <summary>
+ /// Gets the current progress.
+ /// </summary>
+ /// <value>The current progress.</value>
+ double? CurrentProgress { get; }
+
+ /// <summary>
+ /// Gets the triggers that define when the task will run
+ /// </summary>
+ /// <value>The triggers.</value>
+ /// <exception cref="System.ArgumentNullException">value</exception>
+ IEnumerable<ITaskTrigger> Triggers { get; set; }
+
+ /// <summary>
+ /// Gets the unique id.
+ /// </summary>
+ /// <value>The unique id.</value>
+ Guid Id { get; }
+
+ /// <summary>
+ /// Executes the task
+ /// </summary>
+ /// <returns>Task.</returns>
+ /// <exception cref="System.InvalidOperationException">Cannot execute a Task that is already running</exception>
+ Task Execute();
+
+ /// <summary>
+ /// Stops the task if it is currently executing
+ /// </summary>
+ /// <exception cref="System.InvalidOperationException">Cannot cancel a Task unless it is in the Running state.</exception>
+ void Cancel();
+
+ /// <summary>
+ /// Cancels if running.
+ /// </summary>
+ void CancelIfRunning();
+ }
+} \ No newline at end of file