using MediaBrowser.Model.Tasks;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Common.ScheduledTasks
{
public interface ITaskManager : IDisposable
{
///
/// Gets the list of Scheduled Tasks
///
/// The scheduled tasks.
IScheduledTask[] ScheduledTasks { get; }
///
/// Cancels if running and queue.
///
///
void CancelIfRunningAndQueue()
where T : IScheduledTask;
///
/// Queues the scheduled task.
///
///
void QueueScheduledTask()
where T : IScheduledTask;
///
/// Queues the scheduled task.
///
/// The task.
void QueueScheduledTask(IScheduledTask task);
///
/// Adds the tasks.
///
/// The tasks.
void AddTasks(IEnumerable tasks);
///
/// Called when [task completed].
///
/// The task.
/// The start time.
/// The end time.
/// The status.
void OnTaskCompleted(IScheduledTask task, DateTime startTime, DateTime endTime, TaskCompletionStatus status);
///
/// Gets the last execution result.
///
/// The task.
/// TaskResult.
TaskResult GetLastExecutionResult(IScheduledTask task);
///
/// Loads the triggers.
///
/// The task.
/// IEnumerable{BaseTaskTrigger}.
IEnumerable LoadTriggers(IScheduledTask task);
///
/// Saves the triggers.
///
/// The task.
/// The triggers.
void SaveTriggers(IScheduledTask task, IEnumerable triggers);
}
}