ITaskTrigger.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using Microsoft.Extensions.Logging;
  3. namespace MediaBrowser.Model.Tasks
  4. {
  5. /// <summary>
  6. /// Interface ITaskTrigger.
  7. /// </summary>
  8. public interface ITaskTrigger
  9. {
  10. /// <summary>
  11. /// Fires when the trigger condition is satisfied and the task should run.
  12. /// </summary>
  13. event EventHandler<EventArgs>? Triggered;
  14. /// <summary>
  15. /// Gets the options of this task.
  16. /// </summary>
  17. TaskOptions TaskOptions { get; }
  18. /// <summary>
  19. /// Stars waiting for the trigger action.
  20. /// </summary>
  21. /// <param name="lastResult">Result of the last run triggered task.</param>
  22. /// <param name="logger">The <see cref="ILogger"/>.</param>
  23. /// <param name="taskName">The name of the task.</param>
  24. /// <param name="isApplicationStartup">Whether or not this is fired during startup.</param>
  25. void Start(TaskResult? lastResult, ILogger logger, string taskName, bool isApplicationStartup);
  26. /// <summary>
  27. /// Stops waiting for the trigger action.
  28. /// </summary>
  29. void Stop();
  30. }
  31. }