IPsProcessProvider.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Quadarax.Foundation.Core.Data;
  2. namespace qdr.fnd.core.pqueue.Process
  3. {
  4. public interface IPsProcessProvider : IDisposable
  5. {
  6. /// <summary>
  7. /// Collection (dictionary) of running arguments for the process.
  8. /// </summary>
  9. IDictionary<string, TypedArgument> Arguments { get; }
  10. /// <summary>
  11. /// Flag signalizes if the process is running.
  12. /// </summary>
  13. bool IsRunning { get; }
  14. /// <summary>
  15. /// Working/processing item identifier. Points to <see cref="PsQueueItem.Id"/>."/>
  16. /// </summary>
  17. string ItemId { get; }
  18. /// <summary>
  19. /// Gets information when the process started (by calling <see cref="Start"/> operation).
  20. /// If process haven't been started yet, returns null.
  21. /// </summary>
  22. DateTime? StartedTimestamp { get; }
  23. /// <summary>
  24. /// Gets information when the process was finished (by calling <see cref="Stop"/> operation or when operation regullary ends).
  25. /// If process haven't been finished yet, returns null.
  26. /// </summary>
  27. DateTime? FinishedTimestamp { get; }
  28. /// <summary>
  29. /// Validates the process arguments. Throws <see cref="PsProcessProviderException"/> if validation fails.
  30. /// </summary>
  31. void Validate();
  32. /// <summary>
  33. /// Starts the process. Throws <see cref="PsProcessProviderException"/> if the process is already running.
  34. /// </summary>
  35. void Start();
  36. /// <summary>
  37. /// Stops the process. Throws <see cref="PsProcessProviderException"/> if the process is not running.
  38. /// </summary>
  39. void Stop();
  40. /// <summary>
  41. /// Waits till <see cref="IsRunning"/> is false."/>
  42. /// </summary>
  43. void WaitToDone();
  44. }
  45. }