IScheduledTask.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. namespace MediaBrowser.Model.Tasks
  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. string Key { get; }
  18. /// <summary>
  19. /// Gets the description.
  20. /// </summary>
  21. /// <value>The description.</value>
  22. string Description { get; }
  23. /// <summary>
  24. /// Gets the category.
  25. /// </summary>
  26. /// <value>The category.</value>
  27. string Category { get; }
  28. /// <summary>
  29. /// Executes the task
  30. /// </summary>
  31. /// <param name="cancellationToken">The cancellation token.</param>
  32. /// <param name="progress">The progress.</param>
  33. /// <returns>Task.</returns>
  34. Task Execute(CancellationToken cancellationToken, IProgress<double> progress);
  35. /// <summary>
  36. /// Gets the default triggers.
  37. /// </summary>
  38. /// <returns>IEnumerable{BaseTaskTrigger}.</returns>
  39. IEnumerable<TaskTriggerInfo> GetDefaultTriggers();
  40. }
  41. }