using System;
using System.Threading;
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 wait handle on the task condition.
///
/// The task is not latched.
WaitHandle 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; }
}
}