diff --git a/Agent/Phantom.Agent.Minecraft/Instance/InstanceProcess.cs b/Agent/Phantom.Agent.Minecraft/Instance/InstanceProcess.cs index 7c050d8..5ec6ae8 100644 --- a/Agent/Phantom.Agent.Minecraft/Instance/InstanceProcess.cs +++ b/Agent/Phantom.Agent.Minecraft/Instance/InstanceProcess.cs @@ -1,5 +1,5 @@ using Phantom.Utils.Collections; -using Phantom.Utils.Runtime; +using Phantom.Utils.Processes; namespace Phantom.Agent.Minecraft.Instance; diff --git a/Agent/Phantom.Agent.Minecraft/Launcher/BaseLauncher.cs b/Agent/Phantom.Agent.Minecraft/Launcher/BaseLauncher.cs index ab7eb4b..41de525 100644 --- a/Agent/Phantom.Agent.Minecraft/Launcher/BaseLauncher.cs +++ b/Agent/Phantom.Agent.Minecraft/Launcher/BaseLauncher.cs @@ -2,7 +2,7 @@ using Phantom.Agent.Minecraft.Instance; using Phantom.Agent.Minecraft.Java; using Phantom.Agent.Minecraft.Server; -using Phantom.Utils.Runtime; +using Phantom.Utils.Processes; using Serilog; namespace Phantom.Agent.Minecraft.Launcher; diff --git a/Agent/Phantom.Agent.Minecraft/Phantom.Agent.Minecraft.csproj b/Agent/Phantom.Agent.Minecraft/Phantom.Agent.Minecraft.csproj index f04e5dc..b8d1d60 100644 --- a/Agent/Phantom.Agent.Minecraft/Phantom.Agent.Minecraft.csproj +++ b/Agent/Phantom.Agent.Minecraft/Phantom.Agent.Minecraft.csproj @@ -13,10 +13,7 @@ <ItemGroup> <ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" /> <ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.Cryptography\Phantom.Utils.Cryptography.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> + <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" /> </ItemGroup> </Project> diff --git a/Agent/Phantom.Agent.Rpc/RpcLauncher.cs b/Agent/Phantom.Agent.Rpc/RpcLauncher.cs index 3c36254..763b502 100644 --- a/Agent/Phantom.Agent.Rpc/RpcLauncher.cs +++ b/Agent/Phantom.Agent.Rpc/RpcLauncher.cs @@ -6,7 +6,7 @@ using Phantom.Common.Messages.BiDirectional; using Phantom.Common.Messages.ToServer; using Phantom.Utils.Rpc; using Phantom.Utils.Rpc.Message; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using Serilog; using Serilog.Events; diff --git a/Agent/Phantom.Agent.Services/AgentServices.cs b/Agent/Phantom.Agent.Services/AgentServices.cs index 53c3eb3..c3ba7b3 100644 --- a/Agent/Phantom.Agent.Services/AgentServices.cs +++ b/Agent/Phantom.Agent.Services/AgentServices.cs @@ -3,7 +3,7 @@ using Phantom.Agent.Services.Backups; using Phantom.Agent.Services.Instances; using Phantom.Common.Data.Agent; using Phantom.Common.Logging; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using Serilog; namespace Phantom.Agent.Services; diff --git a/Agent/Phantom.Agent.Services/Backups/BackupCompressor.cs b/Agent/Phantom.Agent.Services/Backups/BackupCompressor.cs index db607be..b6db6e6 100644 --- a/Agent/Phantom.Agent.Services/Backups/BackupCompressor.cs +++ b/Agent/Phantom.Agent.Services/Backups/BackupCompressor.cs @@ -1,5 +1,5 @@ using Phantom.Common.Logging; -using Phantom.Utils.Runtime; +using Phantom.Utils.Processes; using Serilog; namespace Phantom.Agent.Services.Backups; diff --git a/Agent/Phantom.Agent.Services/Backups/BackupScheduler.cs b/Agent/Phantom.Agent.Services/Backups/BackupScheduler.cs index 97a966c..3846807 100644 --- a/Agent/Phantom.Agent.Services/Backups/BackupScheduler.cs +++ b/Agent/Phantom.Agent.Services/Backups/BackupScheduler.cs @@ -4,7 +4,8 @@ using Phantom.Agent.Services.Instances; using Phantom.Agent.Services.Instances.Procedures; using Phantom.Common.Data.Backups; using Phantom.Common.Logging; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; +using Phantom.Utils.Threading; namespace Phantom.Agent.Services.Backups; diff --git a/Agent/Phantom.Agent.Services/Backups/BackupServerCommandDispatcher.cs b/Agent/Phantom.Agent.Services/Backups/BackupServerCommandDispatcher.cs index bbb4297..91030b8 100644 --- a/Agent/Phantom.Agent.Services/Backups/BackupServerCommandDispatcher.cs +++ b/Agent/Phantom.Agent.Services/Backups/BackupServerCommandDispatcher.cs @@ -1,7 +1,7 @@ using System.Text.RegularExpressions; using Phantom.Agent.Minecraft.Command; using Phantom.Agent.Minecraft.Instance; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using Serilog; namespace Phantom.Agent.Services.Backups; @@ -14,9 +14,9 @@ sealed partial class BackupServerCommandDispatcher : IDisposable { private readonly InstanceProcess process; private readonly CancellationToken cancellationToken; - private readonly TaskCompletionSource automaticSavingDisabled = Tasks.CreateCompletionSource(); - private readonly TaskCompletionSource savedTheGame = Tasks.CreateCompletionSource(); - private readonly TaskCompletionSource automaticSavingEnabled = Tasks.CreateCompletionSource(); + private readonly TaskCompletionSource automaticSavingDisabled = AsyncTasks.CreateCompletionSource(); + private readonly TaskCompletionSource savedTheGame = AsyncTasks.CreateCompletionSource(); + private readonly TaskCompletionSource automaticSavingEnabled = AsyncTasks.CreateCompletionSource(); public BackupServerCommandDispatcher(ILogger logger, InstanceProcess process, CancellationToken cancellationToken) { this.logger = logger; diff --git a/Agent/Phantom.Agent.Services/Instances/InstanceLogSender.cs b/Agent/Phantom.Agent.Services/Instances/InstanceLogSender.cs index 5f41ae0..0f23707 100644 --- a/Agent/Phantom.Agent.Services/Instances/InstanceLogSender.cs +++ b/Agent/Phantom.Agent.Services/Instances/InstanceLogSender.cs @@ -3,7 +3,7 @@ using System.Threading.Channels; using Phantom.Agent.Rpc; using Phantom.Common.Logging; using Phantom.Common.Messages.ToServer; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; namespace Phantom.Agent.Services.Instances; diff --git a/Agent/Phantom.Agent.Services/Instances/InstanceProcedureManager.cs b/Agent/Phantom.Agent.Services/Instances/InstanceProcedureManager.cs index 0347ecb..695340e 100644 --- a/Agent/Phantom.Agent.Services/Instances/InstanceProcedureManager.cs +++ b/Agent/Phantom.Agent.Services/Instances/InstanceProcedureManager.cs @@ -1,7 +1,7 @@ using Phantom.Agent.Services.Instances.Procedures; using Phantom.Common.Data.Minecraft; -using Phantom.Utils.Collections; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; +using Phantom.Utils.Threading; namespace Phantom.Agent.Services.Instances; diff --git a/Agent/Phantom.Agent.Services/Instances/InstanceServices.cs b/Agent/Phantom.Agent.Services/Instances/InstanceServices.cs index 9f77776..19bd0f2 100644 --- a/Agent/Phantom.Agent.Services/Instances/InstanceServices.cs +++ b/Agent/Phantom.Agent.Services/Instances/InstanceServices.cs @@ -1,6 +1,6 @@ using Phantom.Agent.Minecraft.Launcher; using Phantom.Agent.Services.Backups; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; namespace Phantom.Agent.Services.Instances; diff --git a/Agent/Phantom.Agent.Services/Instances/InstanceSessionManager.cs b/Agent/Phantom.Agent.Services/Instances/InstanceSessionManager.cs index dc04855..3a24ccb 100644 --- a/Agent/Phantom.Agent.Services/Instances/InstanceSessionManager.cs +++ b/Agent/Phantom.Agent.Services/Instances/InstanceSessionManager.cs @@ -16,7 +16,7 @@ using Phantom.Common.Data.Replies; using Phantom.Common.Logging; using Phantom.Common.Messages.ToServer; using Phantom.Utils.IO; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using Serilog; namespace Phantom.Agent.Services.Instances; diff --git a/Agent/Phantom.Agent/Phantom.Agent.csproj b/Agent/Phantom.Agent/Phantom.Agent.csproj index 60e4ff0..fabb08c 100644 --- a/Agent/Phantom.Agent/Phantom.Agent.csproj +++ b/Agent/Phantom.Agent/Phantom.Agent.csproj @@ -12,8 +12,7 @@ </PropertyGroup> <ItemGroup> - <ProjectReference Include="..\..\Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> + <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" /> <ProjectReference Include="..\Phantom.Agent.Minecraft\Phantom.Agent.Minecraft.csproj" /> <ProjectReference Include="..\Phantom.Agent.Services\Phantom.Agent.Services.csproj" /> </ItemGroup> diff --git a/Agent/Phantom.Agent/Program.cs b/Agent/Phantom.Agent/Program.cs index bbcd75a..d14c267 100644 --- a/Agent/Phantom.Agent/Program.cs +++ b/Agent/Phantom.Agent/Program.cs @@ -7,6 +7,7 @@ using Phantom.Common.Data.Agent; using Phantom.Common.Logging; using Phantom.Utils.Rpc; using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; const int ProtocolVersion = 1; diff --git a/Common/Phantom.Common.Data/Phantom.Common.Data.csproj b/Common/Phantom.Common.Data/Phantom.Common.Data.csproj index 1abfb82..d9b7b1f 100644 --- a/Common/Phantom.Common.Data/Phantom.Common.Data.csproj +++ b/Common/Phantom.Common.Data/Phantom.Common.Data.csproj @@ -11,8 +11,7 @@ </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\Utils\Phantom.Utils.Cryptography\Phantom.Utils.Cryptography.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj" /> + <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" /> </ItemGroup> </Project> diff --git a/PhantomPanel.sln b/PhantomPanel.sln index e9523bc..65c226c 100644 --- a/PhantomPanel.sln +++ b/PhantomPanel.sln @@ -48,21 +48,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Server.Web.Componen EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Server.Web.Identity", "Server\Phantom.Server.Web.Identity\Phantom.Server.Web.Identity.csproj", "{A9870842-FE7A-4760-95DC-9D485DDDA31F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Collections", "Utils\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj", "{444AC6C1-E0E1-45C3-965E-BFA818D70913}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Collections.Tests", "Utils\Phantom.Utils.Collections.Tests\Phantom.Utils.Collections.Tests.csproj", "{C418CCDB-2D7E-4B66-8C86-029928AA80A8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Cryptography", "Utils\Phantom.Utils.Cryptography\Phantom.Utils.Cryptography.csproj", "{31661196-164A-4F92-86A1-31F13F4E4C83}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils", "Utils\Phantom.Utils\Phantom.Utils.csproj", "{384885E2-5113-45C5-9B15-09BDA0911852}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Events", "Utils\Phantom.Utils.Events\Phantom.Utils.Events.csproj", "{2E81523B-5DBE-4992-A77B-1679758D0688}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.IO", "Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj", "{388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Rpc", "Utils\Phantom.Utils.Rpc\Phantom.Utils.Rpc.csproj", "{BB112660-7A20-45E6-9195-65363B74027F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Runtime", "Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj", "{6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Runtime.Tests", "Utils\Phantom.Utils.Runtime.Tests\Phantom.Utils.Runtime.Tests.csproj", "{742599E6-2FC2-4B39-85B8-976C98013030}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Phantom.Utils.Tests", "Utils\Phantom.Utils.Tests\Phantom.Utils.Tests.csproj", "{742599E6-2FC2-4B39-85B8-976C98013030}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -138,34 +130,18 @@ Global {A9870842-FE7A-4760-95DC-9D485DDDA31F}.Debug|Any CPU.Build.0 = Debug|Any CPU {A9870842-FE7A-4760-95DC-9D485DDDA31F}.Release|Any CPU.ActiveCfg = Release|Any CPU {A9870842-FE7A-4760-95DC-9D485DDDA31F}.Release|Any CPU.Build.0 = Release|Any CPU - {444AC6C1-E0E1-45C3-965E-BFA818D70913}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {444AC6C1-E0E1-45C3-965E-BFA818D70913}.Debug|Any CPU.Build.0 = Debug|Any CPU - {444AC6C1-E0E1-45C3-965E-BFA818D70913}.Release|Any CPU.ActiveCfg = Release|Any CPU - {444AC6C1-E0E1-45C3-965E-BFA818D70913}.Release|Any CPU.Build.0 = Release|Any CPU - {C418CCDB-2D7E-4B66-8C86-029928AA80A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C418CCDB-2D7E-4B66-8C86-029928AA80A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C418CCDB-2D7E-4B66-8C86-029928AA80A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C418CCDB-2D7E-4B66-8C86-029928AA80A8}.Release|Any CPU.Build.0 = Release|Any CPU - {31661196-164A-4F92-86A1-31F13F4E4C83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {31661196-164A-4F92-86A1-31F13F4E4C83}.Debug|Any CPU.Build.0 = Debug|Any CPU - {31661196-164A-4F92-86A1-31F13F4E4C83}.Release|Any CPU.ActiveCfg = Release|Any CPU - {31661196-164A-4F92-86A1-31F13F4E4C83}.Release|Any CPU.Build.0 = Release|Any CPU + {384885E2-5113-45C5-9B15-09BDA0911852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {384885E2-5113-45C5-9B15-09BDA0911852}.Debug|Any CPU.Build.0 = Debug|Any CPU + {384885E2-5113-45C5-9B15-09BDA0911852}.Release|Any CPU.ActiveCfg = Release|Any CPU + {384885E2-5113-45C5-9B15-09BDA0911852}.Release|Any CPU.Build.0 = Release|Any CPU {2E81523B-5DBE-4992-A77B-1679758D0688}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2E81523B-5DBE-4992-A77B-1679758D0688}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E81523B-5DBE-4992-A77B-1679758D0688}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E81523B-5DBE-4992-A77B-1679758D0688}.Release|Any CPU.Build.0 = Release|Any CPU - {388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E}.Release|Any CPU.Build.0 = Release|Any CPU {BB112660-7A20-45E6-9195-65363B74027F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BB112660-7A20-45E6-9195-65363B74027F}.Debug|Any CPU.Build.0 = Debug|Any CPU {BB112660-7A20-45E6-9195-65363B74027F}.Release|Any CPU.ActiveCfg = Release|Any CPU {BB112660-7A20-45E6-9195-65363B74027F}.Release|Any CPU.Build.0 = Release|Any CPU - {6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD}.Release|Any CPU.Build.0 = Release|Any CPU {742599E6-2FC2-4B39-85B8-976C98013030}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {742599E6-2FC2-4B39-85B8-976C98013030}.Debug|Any CPU.Build.0 = Debug|Any CPU {742599E6-2FC2-4B39-85B8-976C98013030}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -190,13 +166,9 @@ Global {83FA86DB-34E4-4C2C-832C-90F491CA10C7} = {8AC8FB6C-033A-4626-820F-ED0F908756B2} {3F4F9059-F869-42D3-B92C-90D27ADFC42D} = {8AC8FB6C-033A-4626-820F-ED0F908756B2} {A9870842-FE7A-4760-95DC-9D485DDDA31F} = {8AC8FB6C-033A-4626-820F-ED0F908756B2} - {444AC6C1-E0E1-45C3-965E-BFA818D70913} = {AA217EB8-E480-456B-BDF3-39419EF2AD85} - {31661196-164A-4F92-86A1-31F13F4E4C83} = {AA217EB8-E480-456B-BDF3-39419EF2AD85} + {384885E2-5113-45C5-9B15-09BDA0911852} = {AA217EB8-E480-456B-BDF3-39419EF2AD85} {2E81523B-5DBE-4992-A77B-1679758D0688} = {AA217EB8-E480-456B-BDF3-39419EF2AD85} - {388A2C9C-0EE2-45A4-B9EB-76FA12B1AF2E} = {AA217EB8-E480-456B-BDF3-39419EF2AD85} {BB112660-7A20-45E6-9195-65363B74027F} = {AA217EB8-E480-456B-BDF3-39419EF2AD85} - {6D03AEE5-B40F-4FC5-84C0-C9643E4EF8BD} = {AA217EB8-E480-456B-BDF3-39419EF2AD85} - {C418CCDB-2D7E-4B66-8C86-029928AA80A8} = {7A3C7B26-26A0-49B9-8505-5F8267C10F10} {742599E6-2FC2-4B39-85B8-976C98013030} = {7A3C7B26-26A0-49B9-8505-5F8267C10F10} EndGlobalSection EndGlobal diff --git a/Server/Phantom.Server.Minecraft/Phantom.Server.Minecraft.csproj b/Server/Phantom.Server.Minecraft/Phantom.Server.Minecraft.csproj index c20d576..b18f053 100644 --- a/Server/Phantom.Server.Minecraft/Phantom.Server.Minecraft.csproj +++ b/Server/Phantom.Server.Minecraft/Phantom.Server.Minecraft.csproj @@ -9,7 +9,7 @@ <ItemGroup> <ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" /> <ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> + <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" /> </ItemGroup> </Project> diff --git a/Server/Phantom.Server.Rpc/RpcLauncher.cs b/Server/Phantom.Server.Rpc/RpcLauncher.cs index e9b825e..68d1c24 100644 --- a/Server/Phantom.Server.Rpc/RpcLauncher.cs +++ b/Server/Phantom.Server.Rpc/RpcLauncher.cs @@ -4,7 +4,7 @@ using Phantom.Common.Messages.BiDirectional; using Phantom.Common.Messages.ToServer; using Phantom.Utils.Rpc; using Phantom.Utils.Rpc.Message; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using Serilog; using Serilog.Events; diff --git a/Server/Phantom.Server.Services/Agents/AgentManager.cs b/Server/Phantom.Server.Services/Agents/AgentManager.cs index a75d83d..705c143 100644 --- a/Server/Phantom.Server.Services/Agents/AgentManager.cs +++ b/Server/Phantom.Server.Services/Agents/AgentManager.cs @@ -10,7 +10,7 @@ using Phantom.Server.Rpc; using Phantom.Server.Services.Instances; using Phantom.Utils.Collections; using Phantom.Utils.Events; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using ILogger = Serilog.ILogger; namespace Phantom.Server.Services.Agents; diff --git a/Server/Phantom.Server.Services/Audit/AuditLog.cs b/Server/Phantom.Server.Services/Audit/AuditLog.cs index 686f38e..b84d79c 100644 --- a/Server/Phantom.Server.Services/Audit/AuditLog.cs +++ b/Server/Phantom.Server.Services/Audit/AuditLog.cs @@ -4,7 +4,7 @@ using Phantom.Server.Database; using Phantom.Server.Database.Entities; using Phantom.Server.Database.Enums; using Phantom.Server.Services.Users; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; namespace Phantom.Server.Services.Audit; diff --git a/Server/Phantom.Server.Services/Events/EventLog.cs b/Server/Phantom.Server.Services/Events/EventLog.cs index 1f8f0df..9d1e74d 100644 --- a/Server/Phantom.Server.Services/Events/EventLog.cs +++ b/Server/Phantom.Server.Services/Events/EventLog.cs @@ -2,7 +2,7 @@ using Phantom.Server.Database; using Phantom.Server.Database.Entities; using Phantom.Server.Database.Enums; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; namespace Phantom.Server.Services.Events; diff --git a/Server/Phantom.Server.Services/Phantom.Server.Services.csproj b/Server/Phantom.Server.Services/Phantom.Server.Services.csproj index a52d264..eb9d99c 100644 --- a/Server/Phantom.Server.Services/Phantom.Server.Services.csproj +++ b/Server/Phantom.Server.Services/Phantom.Server.Services.csproj @@ -12,7 +12,6 @@ <ItemGroup> <ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" /> <ProjectReference Include="..\..\Utils\Phantom.Utils.Events\Phantom.Utils.Events.csproj" /> <ProjectReference Include="..\Phantom.Server.Database\Phantom.Server.Database.csproj" /> <ProjectReference Include="..\Phantom.Server.Minecraft\Phantom.Server.Minecraft.csproj" /> diff --git a/Server/Phantom.Server.Services/Rpc/MessageToServerListener.cs b/Server/Phantom.Server.Services/Rpc/MessageToServerListener.cs index 69e869f..df29295 100644 --- a/Server/Phantom.Server.Services/Rpc/MessageToServerListener.cs +++ b/Server/Phantom.Server.Services/Rpc/MessageToServerListener.cs @@ -9,7 +9,7 @@ using Phantom.Server.Services.Agents; using Phantom.Server.Services.Events; using Phantom.Server.Services.Instances; using Phantom.Utils.Rpc.Message; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; namespace Phantom.Server.Services.Rpc; @@ -22,7 +22,7 @@ public sealed class MessageToServerListener : IMessageToServerListener { private readonly InstanceLogManager instanceLogManager; private readonly EventLog eventLog; - private readonly TaskCompletionSource<Guid> agentGuidWaiter = Tasks.CreateCompletionSource<Guid>(); + private readonly TaskCompletionSource<Guid> agentGuidWaiter = AsyncTasks.CreateCompletionSource<Guid>(); public bool IsDisposed { get; private set; } diff --git a/Server/Phantom.Server.Web.Identity/Authentication/PhantomLoginStore.cs b/Server/Phantom.Server.Web.Identity/Authentication/PhantomLoginStore.cs index 0a35b74..52acb8f 100644 --- a/Server/Phantom.Server.Web.Identity/Authentication/PhantomLoginStore.cs +++ b/Server/Phantom.Server.Web.Identity/Authentication/PhantomLoginStore.cs @@ -2,7 +2,7 @@ using System.Diagnostics; using Microsoft.AspNetCore.Identity; using Phantom.Common.Logging; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using ILogger = Serilog.ILogger; namespace Phantom.Server.Web.Identity.Authentication; diff --git a/Server/Phantom.Server.Web.Identity/Phantom.Server.Web.Identity.csproj b/Server/Phantom.Server.Web.Identity/Phantom.Server.Web.Identity.csproj index 012dfd9..197563f 100644 --- a/Server/Phantom.Server.Web.Identity/Phantom.Server.Web.Identity.csproj +++ b/Server/Phantom.Server.Web.Identity/Phantom.Server.Web.Identity.csproj @@ -21,8 +21,7 @@ <ItemGroup> <ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.Cryptography\Phantom.Utils.Cryptography.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> + <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" /> <ProjectReference Include="..\Phantom.Server.Database\Phantom.Server.Database.csproj" /> </ItemGroup> diff --git a/Server/Phantom.Server/Phantom.Server.csproj b/Server/Phantom.Server/Phantom.Server.csproj index 940ce4d..f2fdaff 100644 --- a/Server/Phantom.Server/Phantom.Server.csproj +++ b/Server/Phantom.Server/Phantom.Server.csproj @@ -14,8 +14,7 @@ <ItemGroup> <ProjectReference Include="..\..\Common\Phantom.Common.Data\Phantom.Common.Data.csproj" /> <ProjectReference Include="..\..\Common\Phantom.Common.Logging\Phantom.Common.Logging.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.IO\Phantom.Utils.IO.csproj" /> - <ProjectReference Include="..\..\Utils\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> + <ProjectReference Include="..\..\Utils\Phantom.Utils\Phantom.Utils.csproj" /> <ProjectReference Include="..\Phantom.Server.Database.Postgres\Phantom.Server.Database.Postgres.csproj" /> <ProjectReference Include="..\Phantom.Server.Minecraft\Phantom.Server.Minecraft.csproj" /> <ProjectReference Include="..\Phantom.Server.Rpc\Phantom.Server.Rpc.csproj" /> diff --git a/Server/Phantom.Server/Program.cs b/Server/Phantom.Server/Program.cs index 24c0727..82e5d60 100644 --- a/Server/Phantom.Server/Program.cs +++ b/Server/Phantom.Server/Program.cs @@ -11,6 +11,7 @@ using Phantom.Utils.Cryptography; using Phantom.Utils.IO; using Phantom.Utils.Rpc; using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using WebConfiguration = Phantom.Server.Web.Configuration; using WebLauncher = Phantom.Server.Web.Launcher; diff --git a/Server/Phantom.Server/WebConfigurator.cs b/Server/Phantom.Server/WebConfigurator.cs index cfc7d23..815d235 100644 --- a/Server/Phantom.Server/WebConfigurator.cs +++ b/Server/Phantom.Server/WebConfigurator.cs @@ -8,7 +8,7 @@ using Phantom.Server.Services.Events; using Phantom.Server.Services.Instances; using Phantom.Server.Services.Rpc; using Phantom.Server.Services.Users; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using WebLauncher = Phantom.Server.Web.Launcher; namespace Phantom.Server; diff --git a/Utils/Phantom.Utils.Collections.Tests/Phantom.Utils.Collections.Tests.csproj b/Utils/Phantom.Utils.Collections.Tests/Phantom.Utils.Collections.Tests.csproj deleted file mode 100644 index d27df81..0000000 --- a/Utils/Phantom.Utils.Collections.Tests/Phantom.Utils.Collections.Tests.csproj +++ /dev/null @@ -1,25 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <TargetFramework>net7.0</TargetFramework> - <ImplicitUsings>enable</ImplicitUsings> - <Nullable>enable</Nullable> - </PropertyGroup> - - <PropertyGroup> - <IsPackable>false</IsPackable> - </PropertyGroup> - - <ItemGroup> - <PackageReference Include="Microsoft.NET.Test.Sdk" /> - <PackageReference Include="NUnit" /> - <PackageReference Include="NUnit3TestAdapter" /> - <PackageReference Include="NUnit.Analyzers" /> - <PackageReference Include="coverlet.collector" /> - </ItemGroup> - - <ItemGroup> - <ProjectReference Include="..\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" /> - </ItemGroup> - -</Project> diff --git a/Utils/Phantom.Utils.Collections/Phantom.Utils.Collections.csproj b/Utils/Phantom.Utils.Collections/Phantom.Utils.Collections.csproj deleted file mode 100644 index c719eb3..0000000 --- a/Utils/Phantom.Utils.Collections/Phantom.Utils.Collections.csproj +++ /dev/null @@ -1,9 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <TargetFramework>net7.0</TargetFramework> - <ImplicitUsings>enable</ImplicitUsings> - <Nullable>enable</Nullable> - </PropertyGroup> - -</Project> diff --git a/Utils/Phantom.Utils.Events/Phantom.Utils.Events.csproj b/Utils/Phantom.Utils.Events/Phantom.Utils.Events.csproj index 7f9b0fb..17a0642 100644 --- a/Utils/Phantom.Utils.Events/Phantom.Utils.Events.csproj +++ b/Utils/Phantom.Utils.Events/Phantom.Utils.Events.csproj @@ -11,7 +11,7 @@ </ItemGroup> <ItemGroup> - <ProjectReference Include="..\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" /> + <ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" /> </ItemGroup> </Project> diff --git a/Utils/Phantom.Utils.IO/Phantom.Utils.IO.csproj b/Utils/Phantom.Utils.IO/Phantom.Utils.IO.csproj deleted file mode 100644 index 0f7c900..0000000 --- a/Utils/Phantom.Utils.IO/Phantom.Utils.IO.csproj +++ /dev/null @@ -1,9 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <TargetFramework>net7.0</TargetFramework> - <ImplicitUsings>enable</ImplicitUsings> - <Nullable>enable</Nullable> - </PropertyGroup> - -</Project> diff --git a/Utils/Phantom.Utils.Rpc/Message/MessageHandler.cs b/Utils/Phantom.Utils.Rpc/Message/MessageHandler.cs index 2155e66..e2c3856 100644 --- a/Utils/Phantom.Utils.Rpc/Message/MessageHandler.cs +++ b/Utils/Phantom.Utils.Rpc/Message/MessageHandler.cs @@ -1,4 +1,4 @@ -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using Serilog; namespace Phantom.Utils.Rpc.Message; diff --git a/Utils/Phantom.Utils.Rpc/Message/MessageReplyTracker.cs b/Utils/Phantom.Utils.Rpc/Message/MessageReplyTracker.cs index daab7fa..b302425 100644 --- a/Utils/Phantom.Utils.Rpc/Message/MessageReplyTracker.cs +++ b/Utils/Phantom.Utils.Rpc/Message/MessageReplyTracker.cs @@ -1,5 +1,5 @@ using System.Collections.Concurrent; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using Serilog; namespace Phantom.Utils.Rpc.Message; @@ -16,7 +16,7 @@ public sealed class MessageReplyTracker { public uint RegisterReply() { var sequenceId = Interlocked.Increment(ref lastSequenceId); - replyTasks[sequenceId] = Tasks.CreateCompletionSource<byte[]>(); + replyTasks[sequenceId] = AsyncTasks.CreateCompletionSource<byte[]>(); return sequenceId; } diff --git a/Utils/Phantom.Utils.Rpc/Phantom.Utils.Rpc.csproj b/Utils/Phantom.Utils.Rpc/Phantom.Utils.Rpc.csproj index c0d688e..82d3e5d 100644 --- a/Utils/Phantom.Utils.Rpc/Phantom.Utils.Rpc.csproj +++ b/Utils/Phantom.Utils.Rpc/Phantom.Utils.Rpc.csproj @@ -13,7 +13,7 @@ </ItemGroup> <ItemGroup> - <ProjectReference Include="..\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> + <ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" /> </ItemGroup> </Project> diff --git a/Utils/Phantom.Utils.Rpc/RpcRuntime.cs b/Utils/Phantom.Utils.Rpc/RpcRuntime.cs index 7329101..0a86fdf 100644 --- a/Utils/Phantom.Utils.Rpc/RpcRuntime.cs +++ b/Utils/Phantom.Utils.Rpc/RpcRuntime.cs @@ -1,6 +1,6 @@ using NetMQ; using Phantom.Utils.Rpc.Message; -using Phantom.Utils.Runtime; +using Phantom.Utils.Tasks; using Serilog; namespace Phantom.Utils.Rpc; diff --git a/Utils/Phantom.Utils.Runtime/Phantom.Utils.Runtime.csproj b/Utils/Phantom.Utils.Runtime/Phantom.Utils.Runtime.csproj deleted file mode 100644 index 9fac051..0000000 --- a/Utils/Phantom.Utils.Runtime/Phantom.Utils.Runtime.csproj +++ /dev/null @@ -1,17 +0,0 @@ -<Project Sdk="Microsoft.NET.Sdk"> - - <PropertyGroup> - <TargetFramework>net7.0</TargetFramework> - <ImplicitUsings>enable</ImplicitUsings> - <Nullable>enable</Nullable> - </PropertyGroup> - - <ItemGroup> - <PackageReference Include="Serilog" /> - </ItemGroup> - - <ItemGroup> - <ProjectReference Include="..\Phantom.Utils.Collections\Phantom.Utils.Collections.csproj" /> - </ItemGroup> - -</Project> diff --git a/Utils/Phantom.Utils.Collections.Tests/RingBufferTests.cs b/Utils/Phantom.Utils.Tests/Collections/RingBufferTests.cs similarity index 97% rename from Utils/Phantom.Utils.Collections.Tests/RingBufferTests.cs rename to Utils/Phantom.Utils.Tests/Collections/RingBufferTests.cs index e9dee00..95e362e 100644 --- a/Utils/Phantom.Utils.Collections.Tests/RingBufferTests.cs +++ b/Utils/Phantom.Utils.Tests/Collections/RingBufferTests.cs @@ -1,6 +1,7 @@ using NUnit.Framework; +using Phantom.Utils.Collections; -namespace Phantom.Utils.Collections.Tests; +namespace Phantom.Utils.Tests.Collections; [TestFixture] public sealed class RingBufferTests { diff --git a/Utils/Phantom.Utils.Runtime.Tests/Phantom.Utils.Runtime.Tests.csproj b/Utils/Phantom.Utils.Tests/Phantom.Utils.Tests.csproj similarity index 87% rename from Utils/Phantom.Utils.Runtime.Tests/Phantom.Utils.Runtime.Tests.csproj rename to Utils/Phantom.Utils.Tests/Phantom.Utils.Tests.csproj index 89f06ec..1a5aa73 100644 --- a/Utils/Phantom.Utils.Runtime.Tests/Phantom.Utils.Runtime.Tests.csproj +++ b/Utils/Phantom.Utils.Tests/Phantom.Utils.Tests.csproj @@ -19,7 +19,7 @@ </ItemGroup> <ItemGroup> - <ProjectReference Include="..\Phantom.Utils.Runtime\Phantom.Utils.Runtime.csproj" /> + <ProjectReference Include="..\Phantom.Utils\Phantom.Utils.csproj" /> </ItemGroup> </Project> diff --git a/Utils/Phantom.Utils.Runtime.Tests/EnvironmentVariablesTests.cs b/Utils/Phantom.Utils.Tests/Runtime/EnvironmentVariablesTests.cs similarity index 98% rename from Utils/Phantom.Utils.Runtime.Tests/EnvironmentVariablesTests.cs rename to Utils/Phantom.Utils.Tests/Runtime/EnvironmentVariablesTests.cs index c8db1bd..0242e72 100644 --- a/Utils/Phantom.Utils.Runtime.Tests/EnvironmentVariablesTests.cs +++ b/Utils/Phantom.Utils.Tests/Runtime/EnvironmentVariablesTests.cs @@ -1,6 +1,7 @@ using NUnit.Framework; +using Phantom.Utils.Runtime; -namespace Phantom.Utils.Runtime.Tests; +namespace Phantom.Utils.Tests.Runtime; [TestFixture] [FixtureLifeCycle(LifeCycle.InstancePerTestCase)] diff --git a/Utils/Phantom.Utils.Collections/EnumerableExtensions.cs b/Utils/Phantom.Utils/Collections/EnumerableExtensions.cs similarity index 100% rename from Utils/Phantom.Utils.Collections/EnumerableExtensions.cs rename to Utils/Phantom.Utils/Collections/EnumerableExtensions.cs diff --git a/Utils/Phantom.Utils.Collections/ReferenceEqualityComparer.cs b/Utils/Phantom.Utils/Collections/ReferenceEqualityComparer.cs similarity index 100% rename from Utils/Phantom.Utils.Collections/ReferenceEqualityComparer.cs rename to Utils/Phantom.Utils/Collections/ReferenceEqualityComparer.cs diff --git a/Utils/Phantom.Utils.Collections/RingBuffer.cs b/Utils/Phantom.Utils/Collections/RingBuffer.cs similarity index 100% rename from Utils/Phantom.Utils.Collections/RingBuffer.cs rename to Utils/Phantom.Utils/Collections/RingBuffer.cs diff --git a/Utils/Phantom.Utils.Collections/RwLockedDictionary.cs b/Utils/Phantom.Utils/Collections/RwLockedDictionary.cs similarity index 100% rename from Utils/Phantom.Utils.Collections/RwLockedDictionary.cs rename to Utils/Phantom.Utils/Collections/RwLockedDictionary.cs diff --git a/Utils/Phantom.Utils.Collections/RwLockedObservableDictionary.cs b/Utils/Phantom.Utils/Collections/RwLockedObservableDictionary.cs similarity index 100% rename from Utils/Phantom.Utils.Collections/RwLockedObservableDictionary.cs rename to Utils/Phantom.Utils/Collections/RwLockedObservableDictionary.cs diff --git a/Utils/Phantom.Utils.Collections/Table.cs b/Utils/Phantom.Utils/Collections/Table.cs similarity index 100% rename from Utils/Phantom.Utils.Collections/Table.cs rename to Utils/Phantom.Utils/Collections/Table.cs diff --git a/Utils/Phantom.Utils.Cryptography/Base24.cs b/Utils/Phantom.Utils/Cryptography/Base24.cs similarity index 100% rename from Utils/Phantom.Utils.Cryptography/Base24.cs rename to Utils/Phantom.Utils/Cryptography/Base24.cs diff --git a/Utils/Phantom.Utils.Cryptography/Sha1String.cs b/Utils/Phantom.Utils/Cryptography/Sha1String.cs similarity index 100% rename from Utils/Phantom.Utils.Cryptography/Sha1String.cs rename to Utils/Phantom.Utils/Cryptography/Sha1String.cs diff --git a/Utils/Phantom.Utils.Cryptography/StableHashCode.cs b/Utils/Phantom.Utils/Cryptography/StableHashCode.cs similarity index 100% rename from Utils/Phantom.Utils.Cryptography/StableHashCode.cs rename to Utils/Phantom.Utils/Cryptography/StableHashCode.cs diff --git a/Utils/Phantom.Utils.Cryptography/TokenGenerator.cs b/Utils/Phantom.Utils/Cryptography/TokenGenerator.cs similarity index 100% rename from Utils/Phantom.Utils.Cryptography/TokenGenerator.cs rename to Utils/Phantom.Utils/Cryptography/TokenGenerator.cs diff --git a/Utils/Phantom.Utils.IO/Chmod.cs b/Utils/Phantom.Utils/IO/Chmod.cs similarity index 100% rename from Utils/Phantom.Utils.IO/Chmod.cs rename to Utils/Phantom.Utils/IO/Chmod.cs diff --git a/Utils/Phantom.Utils.IO/Directories.cs b/Utils/Phantom.Utils/IO/Directories.cs similarity index 100% rename from Utils/Phantom.Utils.IO/Directories.cs rename to Utils/Phantom.Utils/IO/Directories.cs diff --git a/Utils/Phantom.Utils.IO/FileSize.cs b/Utils/Phantom.Utils/IO/FileSize.cs similarity index 100% rename from Utils/Phantom.Utils.IO/FileSize.cs rename to Utils/Phantom.Utils/IO/FileSize.cs diff --git a/Utils/Phantom.Utils.IO/Files.cs b/Utils/Phantom.Utils/IO/Files.cs similarity index 100% rename from Utils/Phantom.Utils.IO/Files.cs rename to Utils/Phantom.Utils/IO/Files.cs diff --git a/Utils/Phantom.Utils.IO/Paths.cs b/Utils/Phantom.Utils/IO/Paths.cs similarity index 100% rename from Utils/Phantom.Utils.IO/Paths.cs rename to Utils/Phantom.Utils/IO/Paths.cs diff --git a/Utils/Phantom.Utils.IO/StreamCopier.cs b/Utils/Phantom.Utils/IO/StreamCopier.cs similarity index 100% rename from Utils/Phantom.Utils.IO/StreamCopier.cs rename to Utils/Phantom.Utils/IO/StreamCopier.cs diff --git a/Utils/Phantom.Utils.Cryptography/Phantom.Utils.Cryptography.csproj b/Utils/Phantom.Utils/Phantom.Utils.csproj similarity index 72% rename from Utils/Phantom.Utils.Cryptography/Phantom.Utils.Cryptography.csproj rename to Utils/Phantom.Utils/Phantom.Utils.csproj index 0f7c900..d407ef5 100644 --- a/Utils/Phantom.Utils.Cryptography/Phantom.Utils.Cryptography.csproj +++ b/Utils/Phantom.Utils/Phantom.Utils.csproj @@ -5,5 +5,9 @@ <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> - + + <ItemGroup> + <PackageReference Include="Serilog" /> + </ItemGroup> + </Project> diff --git a/Utils/Phantom.Utils.Runtime/OneShotProcess.cs b/Utils/Phantom.Utils/Processes/OneShotProcess.cs similarity index 97% rename from Utils/Phantom.Utils.Runtime/OneShotProcess.cs rename to Utils/Phantom.Utils/Processes/OneShotProcess.cs index a5090b1..4409908 100644 --- a/Utils/Phantom.Utils.Runtime/OneShotProcess.cs +++ b/Utils/Phantom.Utils/Processes/OneShotProcess.cs @@ -1,6 +1,6 @@ using Serilog; -namespace Phantom.Utils.Runtime; +namespace Phantom.Utils.Processes; public sealed class OneShotProcess { private readonly ILogger logger; diff --git a/Utils/Phantom.Utils.Runtime/Process.cs b/Utils/Phantom.Utils/Processes/Process.cs similarity index 98% rename from Utils/Phantom.Utils.Runtime/Process.cs rename to Utils/Phantom.Utils/Processes/Process.cs index 37b333d..5c42370 100644 --- a/Utils/Phantom.Utils.Runtime/Process.cs +++ b/Utils/Phantom.Utils/Processes/Process.cs @@ -1,6 +1,6 @@ using System.Diagnostics; -namespace Phantom.Utils.Runtime; +namespace Phantom.Utils.Processes; public sealed class Process : IDisposable { public readonly record struct Output(string Line, bool IsError); diff --git a/Utils/Phantom.Utils.Runtime/ProcessConfigurator.cs b/Utils/Phantom.Utils/Processes/ProcessConfigurator.cs similarity index 96% rename from Utils/Phantom.Utils.Runtime/ProcessConfigurator.cs rename to Utils/Phantom.Utils/Processes/ProcessConfigurator.cs index 66f7a90..83bea6a 100644 --- a/Utils/Phantom.Utils.Runtime/ProcessConfigurator.cs +++ b/Utils/Phantom.Utils/Processes/ProcessConfigurator.cs @@ -1,7 +1,7 @@ using System.Collections.ObjectModel; using System.Diagnostics; -namespace Phantom.Utils.Runtime; +namespace Phantom.Utils.Processes; public sealed class ProcessConfigurator { private readonly ProcessStartInfo startInfo = new () { diff --git a/Utils/Phantom.Utils.Runtime/AssemblyAttributes.cs b/Utils/Phantom.Utils/Runtime/AssemblyAttributes.cs similarity index 100% rename from Utils/Phantom.Utils.Runtime/AssemblyAttributes.cs rename to Utils/Phantom.Utils/Runtime/AssemblyAttributes.cs diff --git a/Utils/Phantom.Utils.Runtime/EnvironmentVariables.cs b/Utils/Phantom.Utils/Runtime/EnvironmentVariables.cs similarity index 100% rename from Utils/Phantom.Utils.Runtime/EnvironmentVariables.cs rename to Utils/Phantom.Utils/Runtime/EnvironmentVariables.cs diff --git a/Utils/Phantom.Utils.Runtime/PosixSignals.cs b/Utils/Phantom.Utils/Runtime/PosixSignals.cs similarity index 100% rename from Utils/Phantom.Utils.Runtime/PosixSignals.cs rename to Utils/Phantom.Utils/Runtime/PosixSignals.cs diff --git a/Utils/Phantom.Utils.Runtime/StopProcedureException.cs b/Utils/Phantom.Utils/Runtime/StopProcedureException.cs similarity index 100% rename from Utils/Phantom.Utils.Runtime/StopProcedureException.cs rename to Utils/Phantom.Utils/Runtime/StopProcedureException.cs diff --git a/Utils/Phantom.Utils.Runtime/Tasks.cs b/Utils/Phantom.Utils/Tasks/AsyncTasks.cs similarity index 82% rename from Utils/Phantom.Utils.Runtime/Tasks.cs rename to Utils/Phantom.Utils/Tasks/AsyncTasks.cs index 670027f..c329d53 100644 --- a/Utils/Phantom.Utils.Runtime/Tasks.cs +++ b/Utils/Phantom.Utils/Tasks/AsyncTasks.cs @@ -1,6 +1,6 @@ -namespace Phantom.Utils.Runtime; +namespace Phantom.Utils.Tasks; -public static class Tasks { +public static class AsyncTasks { public static TaskCompletionSource CreateCompletionSource() { return new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); } diff --git a/Utils/Phantom.Utils.Runtime/CancellableBackgroundTask.cs b/Utils/Phantom.Utils/Tasks/CancellableBackgroundTask.cs similarity index 97% rename from Utils/Phantom.Utils.Runtime/CancellableBackgroundTask.cs rename to Utils/Phantom.Utils/Tasks/CancellableBackgroundTask.cs index e45806d..75edee6 100644 --- a/Utils/Phantom.Utils.Runtime/CancellableBackgroundTask.cs +++ b/Utils/Phantom.Utils/Tasks/CancellableBackgroundTask.cs @@ -1,6 +1,6 @@ using Serilog; -namespace Phantom.Utils.Runtime; +namespace Phantom.Utils.Tasks; public abstract class CancellableBackgroundTask { private readonly CancellationTokenSource cancellationTokenSource = new (); diff --git a/Utils/Phantom.Utils.Runtime/TaskManager.cs b/Utils/Phantom.Utils/Tasks/TaskManager.cs similarity index 98% rename from Utils/Phantom.Utils.Runtime/TaskManager.cs rename to Utils/Phantom.Utils/Tasks/TaskManager.cs index 5d36877..696bd57 100644 --- a/Utils/Phantom.Utils.Runtime/TaskManager.cs +++ b/Utils/Phantom.Utils/Tasks/TaskManager.cs @@ -2,7 +2,7 @@ using Phantom.Utils.Collections; using Serilog; -namespace Phantom.Utils.Runtime; +namespace Phantom.Utils.Tasks; public sealed class TaskManager { private readonly ILogger logger; diff --git a/Utils/Phantom.Utils.Collections/ThreadSafeLinkedList.cs b/Utils/Phantom.Utils/Threading/ThreadSafeLinkedList.cs similarity index 95% rename from Utils/Phantom.Utils.Collections/ThreadSafeLinkedList.cs rename to Utils/Phantom.Utils/Threading/ThreadSafeLinkedList.cs index ccb3661..ff1a9e3 100644 --- a/Utils/Phantom.Utils.Collections/ThreadSafeLinkedList.cs +++ b/Utils/Phantom.Utils/Threading/ThreadSafeLinkedList.cs @@ -1,4 +1,4 @@ -namespace Phantom.Utils.Collections; +namespace Phantom.Utils.Threading; public sealed class ThreadSafeLinkedList<T> : IDisposable { private readonly LinkedList<T> list = new (); diff --git a/Utils/Phantom.Utils.Runtime/ThreadSafeStructRef.cs b/Utils/Phantom.Utils/Threading/ThreadSafeStructRef.cs similarity index 93% rename from Utils/Phantom.Utils.Runtime/ThreadSafeStructRef.cs rename to Utils/Phantom.Utils/Threading/ThreadSafeStructRef.cs index 53ae9e2..fda7536 100644 --- a/Utils/Phantom.Utils.Runtime/ThreadSafeStructRef.cs +++ b/Utils/Phantom.Utils/Threading/ThreadSafeStructRef.cs @@ -1,4 +1,4 @@ -namespace Phantom.Utils.Runtime; +namespace Phantom.Utils.Threading; public sealed class ThreadSafeStructRef<T> : IDisposable where T : struct { private T? value; diff --git a/Utils/Phantom.Utils.Runtime/WaitHandleExtensions.cs b/Utils/Phantom.Utils/Threading/WaitHandleExtensions.cs similarity index 95% rename from Utils/Phantom.Utils.Runtime/WaitHandleExtensions.cs rename to Utils/Phantom.Utils/Threading/WaitHandleExtensions.cs index 460b1c7..ba548b9 100644 --- a/Utils/Phantom.Utils.Runtime/WaitHandleExtensions.cs +++ b/Utils/Phantom.Utils/Threading/WaitHandleExtensions.cs @@ -1,4 +1,4 @@ -namespace Phantom.Utils.Runtime; +namespace Phantom.Utils.Threading; public static class WaitHandleExtensions { public static Task WaitOneAsync(this WaitHandle waitHandle, CancellationToken cancellationToken = default) {