IScheduledTask.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. /// <summary>
  18. /// Gets the key of the task.
  19. /// </summary>
  20. string Key { get; }
  21. /// <summary>
  22. /// Gets the description.
  23. /// </summary>
  24. /// <value>The description.</value>
  25. string Description { get; }
  26. /// <summary>
  27. /// Gets the category.
  28. /// </summary>
  29. /// <value>The category.</value>
  30. string Category { get; }
  31. /// <summary>
  32. /// Executes the task.
  33. /// </summary>
  34. /// <param name="progress">The progress.</param>
  35. /// <param name="cancellationToken">The cancellation token.</param>
  36. /// <returns>Task.</returns>
  37. Task ExecuteAsync(IProgress<double> progress, CancellationToken cancellationToken);
  38. /// <summary>
  39. /// Gets the default triggers that define when the task will run.
  40. /// </summary>
  41. /// <returns>The default triggers that define when the task will run.</returns>
  42. IEnumerable<TaskTriggerInfo> GetDefaultTriggers();
  43. }
  44. }