using MediaBrowser.Model.Tasks;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace MediaBrowser.Common.ScheduledTasks
{
///
/// Interface IScheduledTask
///
public interface IScheduledTask : IDisposable
{
///
/// Gets the triggers.
///
/// The triggers.
IEnumerable Triggers { get; set; }
///
/// Gets the last execution result.
///
/// The last execution result.
TaskResult LastExecutionResult { get; }
///
/// Gets the state.
///
/// The state.
TaskState State { get; }
///
/// Gets the current progress.
///
/// The current progress.
double? CurrentProgress { get; }
///
/// Gets the name of the task
///
/// The name.
string Name { get; }
///
/// Gets the description.
///
/// The description.
string Description { get; }
///
/// Gets the category.
///
/// The category.
string Category { get; }
///
/// Gets the unique id.
///
/// The unique id.
Guid Id { get; }
///
/// Executes the task
///
/// Task.
/// Cannot execute a Task that is already running
Task Execute();
///
/// Stops the task if it is currently executing
///
/// Cannot cancel a Task unless it is in the Running state.
void Cancel();
///
/// Cancels if running.
///
void CancelIfRunning();
}
}