IScheduledTask.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma warning disable CS1591
  2. #pragma warning disable SA1600
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. namespace MediaBrowser.Model.Tasks
  8. {
  9. /// <summary>
  10. /// Interface IScheduledTaskWorker
  11. /// </summary>
  12. public interface IScheduledTask
  13. {
  14. /// <summary>
  15. /// Gets the name of the task
  16. /// </summary>
  17. /// <value>The name.</value>
  18. string Name { get; }
  19. string Key { get; }
  20. /// <summary>
  21. /// Gets the description.
  22. /// </summary>
  23. /// <value>The description.</value>
  24. string Description { get; }
  25. /// <summary>
  26. /// Gets the category.
  27. /// </summary>
  28. /// <value>The category.</value>
  29. string Category { get; }
  30. /// <summary>
  31. /// Executes the task
  32. /// </summary>
  33. /// <param name="cancellationToken">The cancellation token.</param>
  34. /// <param name="progress">The progress.</param>
  35. /// <returns>Task.</returns>
  36. Task Execute(CancellationToken cancellationToken, IProgress<double> progress);
  37. /// <summary>
  38. /// Gets the default triggers that define when the task will run.
  39. /// </summary>
  40. /// <returns>The default triggers that define when the task will run.</returns>
  41. IEnumerable<TaskTriggerInfo> GetDefaultTriggers();
  42. }
  43. }