diff options
| author | Shadowghost <Ghost_of_Stone@web.de> | 2024-09-04 17:38:10 +0200 |
|---|---|---|
| committer | Shadowghost <Ghost_of_Stone@web.de> | 2024-09-04 17:38:10 +0200 |
| commit | 08ed0a9a5d2a241abe4304e03fab4ae74291e3c9 (patch) | |
| tree | 5e591bea0a6b2f9b8705aad7e5e44e1cb2768b5c /MediaBrowser.Model/Tasks/ITaskManager.cs | |
| parent | 737a1b8a37e95bb4ed5e622d53209fa498239084 (diff) | |
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; } |
