IScheduledTask.cs 1.2 KB

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