jellyfin-server/MediaBrowser.Model/Tasks/ITaskTrigger.cs

36 lines
1.1 KiB
C#
Raw Normal View History

using System;
using Microsoft.Extensions.Logging;
2018-12-27 23:27:57 +00:00
namespace MediaBrowser.Model.Tasks
{
/// <summary>
2020-02-04 00:49:27 +00:00
/// Interface ITaskTrigger.
2018-12-27 23:27:57 +00:00
/// </summary>
public interface ITaskTrigger
{
/// <summary>
2020-02-04 00:49:27 +00:00
/// Fires when the trigger condition is satisfied and the task should run.
2018-12-27 23:27:57 +00:00
/// </summary>
event EventHandler<EventArgs>? Triggered;
2018-12-27 23:27:57 +00:00
/// <summary>
2021-05-28 12:33:54 +00:00
/// Gets the options of this task.
2018-12-27 23:27:57 +00:00
/// </summary>
2021-05-28 12:33:54 +00:00
TaskOptions TaskOptions { get; }
2018-12-27 23:27:57 +00:00
/// <summary>
2020-02-04 00:49:27 +00:00
/// Stars waiting for the trigger action.
2018-12-27 23:27:57 +00:00
/// </summary>
/// <param name="lastResult">Result of the last run triggered task.</param>
/// <param name="logger">The <see cref="ILogger"/>.</param>
/// <param name="taskName">The name of the task.</param>
/// <param name="isApplicationStartup">Whether or not this is is fired during startup.</param>
2021-12-15 17:25:36 +00:00
void Start(TaskResult? lastResult, ILogger logger, string taskName, bool isApplicationStartup);
2018-12-27 23:27:57 +00:00
/// <summary>
2020-02-04 00:49:27 +00:00
/// Stops waiting for the trigger action.
2018-12-27 23:27:57 +00:00
/// </summary>
void Stop();
}
}