Files
Umbraco-CMS/tests/Umbraco.Tests/LegacyXmlPublishedCache/LegacyBackgroundTask/IBackgroundTask.cs

31 lines
923 B
C#
Raw Normal View History

using System;
2015-02-17 15:09:29 +01:00
using System.Threading;
using System.Threading.Tasks;
namespace Umbraco.Web.Scheduling
{
2015-02-06 16:10:34 +01:00
/// <summary>
/// Represents a background task.
/// </summary>
public interface IBackgroundTask : IDisposable
{
2015-02-06 16:10:34 +01:00
/// <summary>
/// Runs the background task.
/// </summary>
void Run();
2015-02-06 16:10:34 +01:00
/// <summary>
/// Runs the task asynchronously.
/// </summary>
2015-02-17 15:09:29 +01:00
/// <param name="token">A cancellation token.</param>
2015-02-06 16:10:34 +01:00
/// <returns>A <see cref="Task"/> instance representing the execution of the background task.</returns>
/// <exception cref="NotImplementedException">The background task cannot run asynchronously.</exception>
2015-02-17 15:09:29 +01:00
Task RunAsync(CancellationToken token);
2015-02-06 16:10:34 +01:00
/// <summary>
/// Indicates whether the background task can run asynchronously.
/// </summary>
bool IsAsync { get; }
}
2017-07-20 11:21:28 +02:00
}