aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/ScheduledTasks/IScheduledTask.cs
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-02-25 22:43:04 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-02-25 22:43:04 -0500
commit2d06095447b972c8c7239277428e2c67c8b7ca86 (patch)
tree14278bd4c0732ee962b73ff4845e5022e157a0a3 /MediaBrowser.Common/ScheduledTasks/IScheduledTask.cs
parent364fbb9e0c7586afa296ddd7d739df086f4c3533 (diff)
plugin security fixes and other abstractions
Diffstat (limited to 'MediaBrowser.Common/ScheduledTasks/IScheduledTask.cs')
-rw-r--r--MediaBrowser.Common/ScheduledTasks/IScheduledTask.cs56
1 files changed, 8 insertions, 48 deletions
diff --git a/MediaBrowser.Common/ScheduledTasks/IScheduledTask.cs b/MediaBrowser.Common/ScheduledTasks/IScheduledTask.cs
index 6f3a3857f..351e96c7d 100644
--- a/MediaBrowser.Common/ScheduledTasks/IScheduledTask.cs
+++ b/MediaBrowser.Common/ScheduledTasks/IScheduledTask.cs
@@ -1,40 +1,16 @@
-using MediaBrowser.Model.Tasks;
-using System;
+using System;
using System.Collections.Generic;
+using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Common.ScheduledTasks
{
/// <summary>
- /// Interface IScheduledTask
+ /// Interface IScheduledTaskWorker
/// </summary>
- public interface IScheduledTask : IDisposable
+ public interface IScheduledTask
{
/// <summary>
- /// Gets the triggers.
- /// </summary>
- /// <value>The triggers.</value>
- IEnumerable<ITaskTrigger> Triggers { get; set; }
-
- /// <summary>
- /// Gets the last execution result.
- /// </summary>
- /// <value>The last execution result.</value>
- TaskResult LastExecutionResult { 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 name of the task
/// </summary>
/// <value>The name.</value>
@@ -53,28 +29,12 @@ namespace MediaBrowser.Common.ScheduledTasks
string Category { get; }
/// <summary>
- /// Gets the unique id.
- /// </summary>
- /// <value>The unique id.</value>
- Guid Id { get; }
-
- /// <summary>
/// Executes the task
/// </summary>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <param name="progress">The progress.</param>
/// <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();
+ Task Execute(CancellationToken cancellationToken, IProgress<double> progress);
/// <summary>
/// Gets the default triggers.
@@ -82,4 +42,4 @@ namespace MediaBrowser.Common.ScheduledTasks
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
IEnumerable<ITaskTrigger> GetDefaultTriggers();
}
-} \ No newline at end of file
+}