diff options
| author | Niels van Velzen <nielsvanvelzen@users.noreply.github.com> | 2024-09-06 21:58:04 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-06 21:58:04 +0200 |
| commit | 435e50fd9abe63037d459a68cdce62f023eaa84f (patch) | |
| tree | 46476c4e9c8a186f9f8cae9500070c41aba94bcb /MediaBrowser.Model/Tasks/ITaskManager.cs | |
| parent | bafbc2372c3e2b3530de4a7a2ac94043b5950176 (diff) | |
| parent | 994266a54f60d89efd4bc54580f2340d70baf59f (diff) | |
Merge pull request #12578 from Shadowghost/task-cleanup
Cleanup tasks
Diffstat (limited to 'MediaBrowser.Model/Tasks/ITaskManager.cs')
| -rw-r--r-- | MediaBrowser.Model/Tasks/ITaskManager.cs | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/MediaBrowser.Model/Tasks/ITaskManager.cs b/MediaBrowser.Model/Tasks/ITaskManager.cs index 5b55667e8..6066bbde4 100644 --- a/MediaBrowser.Model/Tasks/ITaskManager.cs +++ b/MediaBrowser.Model/Tasks/ITaskManager.cs @@ -1,5 +1,3 @@ -#pragma warning disable CS1591 - using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -7,17 +5,26 @@ using Jellyfin.Data.Events; namespace MediaBrowser.Model.Tasks { + /// <summary> + /// Interface for the TaskManager class. + /// </summary> public interface ITaskManager : IDisposable { + /// <summary> + /// Event handler for task execution. + /// </summary> event EventHandler<GenericEventArgs<IScheduledTaskWorker>>? TaskExecuting; + /// <summary> + /// Event handler for task completion. + /// </summary> event EventHandler<TaskCompletionEventArgs>? TaskCompleted; /// <summary> /// Gets the list of Scheduled Tasks. /// </summary> /// <value>The scheduled tasks.</value> - IScheduledTaskWorker[] ScheduledTasks { get; } + IReadOnlyList<IScheduledTaskWorker> ScheduledTasks { get; } /// <summary> /// Cancels if running and queue. @@ -56,6 +63,10 @@ namespace MediaBrowser.Model.Tasks void QueueScheduledTask<T>() where T : IScheduledTask; + /// <summary> + /// Queues the scheduled task if it is not already running. + /// </summary> + /// <typeparam name="T">An implementation of <see cref="IScheduledTask" />.</typeparam> void QueueIfNotRunning<T>() where T : IScheduledTask; @@ -72,10 +83,24 @@ namespace MediaBrowser.Model.Tasks /// <param name="tasks">The tasks.</param> void AddTasks(IEnumerable<IScheduledTask> tasks); + /// <summary> + /// Adds the tasks. + /// </summary> + /// <param name="task">The tasks.</param> void Cancel(IScheduledTaskWorker task); + /// <summary> + /// Executes the tasks. + /// </summary> + /// <param name="task">The tasks.</param> + /// <param name="options">The options.</param> + /// <returns>The executed tasks.</returns> Task Execute(IScheduledTaskWorker task, TaskOptions options); + /// <summary> + /// Executes the tasks. + /// </summary> + /// <typeparam name="T">An implementation of <see cref="IScheduledTask" />.</typeparam> void Execute<T>() where T : IScheduledTask; } |
