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