ProcessQueue.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Quadarax.Foundation.Core.Business.Processor.Enums;
  7. using Quadarax.Foundation.Core.Business.Processor.Providers;
  8. using Quadarax.Foundation.Core.Business.Processor.Task;
  9. using Quadarax.Foundation.Core.Logging;
  10. using Quadarax.Foundation.Core.Object;
  11. namespace Quadarax.Foundation.Core.Business.Processor.Queue
  12. {
  13. public class ProcessQueue : DisposableObject
  14. {
  15. #region *** Properties ***
  16. public bool IsRunning { get; private set; }
  17. public string QueueIdentifier { get; private set; }
  18. #endregion
  19. #region *** Constructors ***
  20. public ProcessQueue(string processQueueIdentifierToken, IProcessorStorageProvider storage, ProcessQueueConfiguration configuration, CallbackDelegates delegates = null)
  21. {
  22. if (string.IsNullOrEmpty(processQueueIdentifierToken)) throw new ArgumentNullException(nameof(processQueueIdentifierToken));
  23. IdentifierToken = processQueueIdentifierToken;
  24. _delegates = delegates ?? new CallbackDelegates();
  25. _log = new QLogger().GetLogger(GetType());
  26. _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
  27. _storageProvider = storage ?? throw new ArgumentNullException(nameof(storage));
  28. _configuration.Validate();
  29. _processingItems = new ProcessQueueItem[_configuration.WorkersCount];
  30. }
  31. #endregion
  32. #region *** Public Operations ***
  33. public void Start()
  34. {
  35. throw new NotImplementedException();
  36. }
  37. public void Stop()
  38. {
  39. throw new NotImplementedException();
  40. }
  41. public ITaskIdentifier CreateTask()
  42. {
  43. }
  44. public ITaskItem GetTask(ITaskIdentifier id)
  45. {
  46. }
  47. public ITaskItem[] GetTask(ITaskIdentifier[] ids)
  48. {
  49. }
  50. public ITaskIdentifier[] QueryTasks(ProcessStatusEnum[] states, bool onlyValid = true, bool includeDeleted = false)
  51. {
  52. }
  53. #endregion
  54. #region *** Private Operations ***
  55. protected override void OnDisposing()
  56. {
  57. throw new NotImplementedException();
  58. }
  59. #endregion
  60. }
  61. }