|
@@ -3,6 +3,8 @@ using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
|
|
|
+using Quadarax.Foundation.Core.Business.Processor.Enums;
|
|
|
|
|
+using Quadarax.Foundation.Core.Business.Processor.Providers;
|
|
|
using Quadarax.Foundation.Core.Business.Processor.Task;
|
|
using Quadarax.Foundation.Core.Business.Processor.Task;
|
|
|
using Quadarax.Foundation.Core.Logging;
|
|
using Quadarax.Foundation.Core.Logging;
|
|
|
using Quadarax.Foundation.Core.Object;
|
|
using Quadarax.Foundation.Core.Object;
|
|
@@ -12,6 +14,30 @@ namespace Quadarax.Foundation.Core.Business.Processor.Queue
|
|
|
public class ProcessQueue : DisposableObject
|
|
public class ProcessQueue : DisposableObject
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
+ #region *** Properties ***
|
|
|
|
|
+ public bool IsRunning { get; private set; }
|
|
|
|
|
+ public string QueueIdentifier { get; private set; }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region *** Constructors ***
|
|
|
|
|
+ public ProcessQueue(string processQueueIdentifierToken, IProcessorStorageProvider storage, ProcessQueueConfiguration configuration, CallbackDelegates delegates = null)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (string.IsNullOrEmpty(processQueueIdentifierToken)) throw new ArgumentNullException(nameof(processQueueIdentifierToken));
|
|
|
|
|
+ IdentifierToken = processQueueIdentifierToken;
|
|
|
|
|
+ _delegates = delegates ?? new CallbackDelegates();
|
|
|
|
|
+
|
|
|
|
|
+ _log = new QLogger().GetLogger(GetType());
|
|
|
|
|
+ _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
|
|
|
|
|
+ _storageProvider = storage ?? throw new ArgumentNullException(nameof(storage));
|
|
|
|
|
+
|
|
|
|
|
+ _configuration.Validate();
|
|
|
|
|
+ _processingItems = new ProcessQueueItem[_configuration.WorkersCount];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region *** Public Operations ***
|
|
|
public void Start()
|
|
public void Start()
|
|
|
{
|
|
{
|
|
|
throw new NotImplementedException();
|
|
throw new NotImplementedException();
|
|
@@ -35,20 +61,18 @@ namespace Quadarax.Foundation.Core.Business.Processor.Queue
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public bool ContainsPendingTasks()
|
|
|
|
|
|
|
+ public ITaskIdentifier[] QueryTasks(ProcessStatusEnum[] states, bool onlyValid = true, bool includeDeleted = false)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- public bool ContainsProcessingTasks()
|
|
|
|
|
- {
|
|
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ #endregion
|
|
|
|
|
|
|
|
|
|
+ #region *** Private Operations ***
|
|
|
protected override void OnDisposing()
|
|
protected override void OnDisposing()
|
|
|
{
|
|
{
|
|
|
throw new NotImplementedException();
|
|
throw new NotImplementedException();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ #endregion
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|