using System; using System.Threading; using System.Threading.Tasks; namespace Umbraco.Web.Scheduling { /// /// Represents a latched background task. /// /// Latched background tasks can suspend their execution until /// a condition is met. However if the tasks runner has to terminate, /// latched background tasks can be executed immediately, depending on /// the value returned by RunsOnShutdown. internal interface ILatchedBackgroundTask : IBackgroundTask { /// /// Gets a task on latch. /// /// The task is not latched. Task Latch { get; } /// /// Gets a value indicating whether the task is latched. /// /// Should return false as soon as the condition is met. bool IsLatched { get; } /// /// Gets a value indicating whether the task can be executed immediately if the task runner has to terminate. /// bool RunsOnShutdown { get; } } }