add loader and versioning

This commit is contained in:
Alex Bezdieniezhnykh
2025-06-10 08:53:57 +03:00
parent 7750025631
commit dcd0fabc1f
31 changed files with 284 additions and 123 deletions
+12 -2
View File
@@ -10,7 +10,7 @@ using Exception = System.Exception;
namespace Azaion.CommonSecurity.Services;
public class LoaderClient(LoaderClientConfig config, ILogger logger, CancellationToken ct = default)
public class LoaderClient(LoaderClientConfig config, ILogger logger, CancellationToken ct = default) : IDisposable
{
private readonly DealerSocket _dealer = new();
private readonly Guid _clientId = Guid.NewGuid();
@@ -24,7 +24,7 @@ public class LoaderClient(LoaderClientConfig config, ILogger logger, Cancellatio
{
FileName = SecurityConstants.EXTERNAL_LOADER_PATH,
Arguments = $"--port {config.ZeroMqPort} --api {config.ApiUrl}",
CreateNoWindow = true
//CreateNoWindow = true
};
process.OutputDataReceived += (_, e) =>
@@ -90,4 +90,14 @@ public class LoaderClient(LoaderClientConfig config, ILogger logger, Cancellatio
throw;
}
}
public void Stop()
{
_dealer.SendFrame(MessagePackSerializer.Serialize(new RemoteCommand(CommandType.Exit)));
}
public void Dispose()
{
_dealer.Dispose();
}
}