Forráskód Böngészése

Add initial workers layout (included to ComplexWorker). Not implemented yet

Dalibor Votruba 3 éve
szülő
commit
fe77057ffc

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 341 - 324
@Documentation/QLiberace.simp


+ 8 - 0
Common/qdr.fnd.core.business/AbstractService.cs

@@ -1,5 +1,6 @@
 using System;
 using Microsoft.Extensions.Logging;
+using Quadarax.Foundation.Core.Business.Enums;
 using Quadarax.Foundation.Core.Business.Interface;
 using Quadarax.Foundation.Core.Data.Interface.Domain;
 using Quadarax.Foundation.Core.Data.Interface.Entity;
@@ -14,11 +15,14 @@ namespace Quadarax.Foundation.Core.Business
         protected IContext CurrentContext { get; }
 
         protected ILoggerFactory LoggerFactory { get; }
+
+        public ServiceStateEnum State { get; protected set; }
         #endregion
 
         #region *** Constructors ***
         protected AbstractService(IContext currentContext, ILoggerFactory logger)
         {
+            State = ServiceStateEnum.Initializing;
             CurrentContext = currentContext ?? throw new ArgumentNullException(nameof(currentContext));
             if (logger == null)throw new ArgumentNullException(nameof(logger));
             
@@ -31,6 +35,8 @@ namespace Quadarax.Foundation.Core.Business
             //    currentContext = new GenericPrincipal(genericIdentity, new string[] {});
             //}
             Log.LogTrace($"Service '{GetType().Name}' [Hash:{GetHashCode()}] initialized.");
+
+            State = ServiceStateEnum.Online;
         }
         #endregion
 
@@ -60,6 +66,8 @@ namespace Quadarax.Foundation.Core.Business
         #endregion
 
         #region *** Public Operations ***
+
+
         public IResult Test()
         {
             return new ResultPlain();

+ 4 - 0
Common/qdr.fnd.core.business/AbstractWorkerService.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using Microsoft.Extensions.Logging;
+using Quadarax.Foundation.Core.Business.Enums;
 using Quadarax.Foundation.Core.Business.Interface;
 using Quadarax.Foundation.Core.Data.Interface.Domain;
 using Quadarax.Foundation.Core.Data.Interface.Repository;
@@ -28,6 +29,7 @@ namespace Quadarax.Foundation.Core.Business
         #region *** Constructors ***
         protected AbstractWorkerService(IWorkerSettings workerSettings, TRepository repository, IContext currentContext, ILoggerFactory logger) : base(repository, currentContext, logger)
         {
+            State = ServiceStateEnum.Initializing;
             _wrkSettings = workerSettings ?? throw new ArgumentNullException(nameof(workerSettings));
             InitInternal();
         }
@@ -51,6 +53,7 @@ namespace Quadarax.Foundation.Core.Business
                 }
 
                 _lockTransient = null;
+                State = ServiceStateEnum.Online;
             }
         }
         public void Stop()
@@ -67,6 +70,7 @@ namespace Quadarax.Foundation.Core.Business
 
                 }
                 _lockTransient = null;
+                State = ServiceStateEnum.Offline;
             }
         }
 

+ 9 - 0
Common/qdr.fnd.core.business/Enums/ServiceStateEnum.cs

@@ -0,0 +1,9 @@
+namespace Quadarax.Foundation.Core.Business.Enums
+{
+    public enum ServiceStateEnum
+    {
+        Initializing,
+        Online,
+        Offline
+    }
+}

+ 4 - 1
Common/qdr.fnd.core.business/Interface/IService.cs

@@ -1,9 +1,12 @@
-using Quadarax.Foundation.Core.Data.Interface.Entity;
+using Quadarax.Foundation.Core.Business.Enums;
+using Quadarax.Foundation.Core.Data.Interface.Entity;
 
 namespace Quadarax.Foundation.Core.Business.Interface
 {
     public interface IService
     {
+        ServiceStateEnum State { get; }
         IResult Test();
+
     }
 }

+ 9 - 0
Modules/qdr.app.qlbrc.base/Constants.cs

@@ -36,6 +36,15 @@
                 public const string TblCustomerUser = "CustomerUser";
 
             }
+
+            public class Processor
+            {
+                public const string Name = "Processor";
+                public const string Code = "processor";
+                public const string Schema = "processor";
+
+
+            }
         }
     }
 }

+ 0 - 7
Modules/qdr.app.qlbrc.processor/Class1.cs

@@ -1,7 +0,0 @@
-namespace qdr.app.qlbrc.processor
-{
-    public class Class1
-    {
-
-    }
-}

+ 17 - 0
Modules/qdr.app.qlbrc.processor/Constants.cs

@@ -0,0 +1,17 @@
+namespace Quadarax.Application.QLiberace.Processor
+{
+    public class Constants
+    {
+        public class Modules
+        {
+            public class Processor
+            {
+                public const string PrefixComplex = "cpx";
+                public const string PrefixProcessing = "prc";
+                public const string PrefixExecuting = "exe";
+                public const string PrefixGarbage = "grb";
+                public const string PrefixRetention = "ret";
+            }
+        }
+    }
+}

+ 31 - 0
Modules/qdr.app.qlbrc.processor/Settings/ProcessorSetting.cs

@@ -0,0 +1,31 @@
+using Quadarax.Application.QLiberace.Common.Attributes;
+using Quadarax.Application.QLiberace.Common.Settings;
+using Quadarax.Application.QLiberace.Processor.Workers;
+
+namespace Quadarax.Application.QLiberace.Processor.Settings
+{
+    [Module(Base.Constants.Modules.Processor.Code)]
+    public class ProcessorSetting : ModuleSetting
+    {
+        /// <summary>
+        /// Defines number of <see cref="ComplexWorker"/> working parallel
+        /// </summary>
+        public int Workers { get; set; }
+        /// <summary>
+        /// Defines number of <see cref="ExecutingWorker"/> working under one instance of <see cref="ComplexWorker"/>
+        /// </summary>
+        public int ExecutingThreadsPerWorker { get; set; }
+        /// <summary>
+        /// Defines number of <see cref="ProcessingWorker"/> working under one instance of <see cref="ComplexWorker"/>
+        /// </summary>
+        public int ProcessingThreadsPerWorker { get; set; }
+        /// <summary>
+        /// Defines number of <see cref="GarbageWorker"/> working under one instance of <see cref="ComplexWorker"/>
+        /// </summary>
+        public int GarbageThreadsPerWorker { get; set; }
+        /// <summary>
+        /// Defines number of <see cref="RetentionWorker"/> working under one instance of <see cref="ComplexWorker"/>
+        /// </summary>
+        public int RetentionThreadsPerWorker { get; set; }
+    }
+}

+ 6 - 0
Modules/qdr.app.qlbrc.processor/Workers/ComplexWorker.cs

@@ -0,0 +1,6 @@
+namespace Quadarax.Application.QLiberace.Processor.Workers
+{
+    public class ComplexWorker
+    {
+    }
+}

+ 12 - 0
Modules/qdr.app.qlbrc.processor/Workers/ExecutingWorker.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Quadarax.Application.QLiberace.Processor.Workers
+{
+    internal class ExecutingWorker
+    {
+    }
+}

+ 12 - 0
Modules/qdr.app.qlbrc.processor/Workers/GarbageWorker.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Quadarax.Application.QLiberace.Processor.Workers
+{
+    internal class GarbageWorker
+    {
+    }
+}

+ 12 - 0
Modules/qdr.app.qlbrc.processor/Workers/ProcessingWorker.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Quadarax.Application.QLiberace.Processor.Workers
+{
+    internal class ProcessingWorker
+    {
+    }
+}

+ 12 - 0
Modules/qdr.app.qlbrc.processor/Workers/RetentionWorker.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Quadarax.Application.QLiberace.Processor.Workers
+{
+    internal class RetentionWorker
+    {
+    }
+}

+ 0 - 1
Modules/qdr.app.qlbrc.processor/qdr.app.qlbrc.processor.csproj

@@ -16,7 +16,6 @@
 
   <ItemGroup>
     <Folder Include="Services\Static\" />
-    <Folder Include="Workers\" />
   </ItemGroup>
 
 </Project>

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott