mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:46:30 +00:00
add loader and versioning
This commit is contained in:
@@ -137,6 +137,9 @@ public class GpsMatcherClient : IGpsMatcherClient
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_poller.Stop();
|
||||
_poller.Dispose();
|
||||
|
||||
_requestSocket.SendFrame("EXIT");
|
||||
_requestSocket.Disconnect(_requestAddress);
|
||||
_requestSocket.Dispose();
|
||||
|
||||
@@ -23,7 +23,7 @@ public interface IInferenceClient : IDisposable
|
||||
void Stop();
|
||||
}
|
||||
|
||||
public class InferenceClient(IOptions<InferenceClientConfig> inferenceConfig, IOptions<LoaderClientConfig> loaderConfig) : IInferenceClient
|
||||
public class InferenceClient : IInferenceClient
|
||||
{
|
||||
public event EventHandler<RemoteCommand>? BytesReceived;
|
||||
public event EventHandler<RemoteCommand>? InferenceDataReceived;
|
||||
@@ -32,8 +32,15 @@ public class InferenceClient(IOptions<InferenceClientConfig> inferenceConfig, IO
|
||||
private readonly DealerSocket _dealer = new();
|
||||
private readonly NetMQPoller _poller = new();
|
||||
private readonly Guid _clientId = Guid.NewGuid();
|
||||
private readonly InferenceClientConfig _inferenceClientConfig = inferenceConfig.Value;
|
||||
private readonly LoaderClientConfig _loaderClientConfig = loaderConfig.Value;
|
||||
private readonly InferenceClientConfig _inferenceClientConfig;
|
||||
private readonly LoaderClientConfig _loaderClientConfig;
|
||||
|
||||
public InferenceClient(IOptions<InferenceClientConfig> inferenceConfig, IOptions<LoaderClientConfig> loaderConfig)
|
||||
{
|
||||
_inferenceClientConfig = inferenceConfig.Value;
|
||||
_loaderClientConfig = loaderConfig.Value;
|
||||
Start();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
@@ -43,7 +50,7 @@ public class InferenceClient(IOptions<InferenceClientConfig> inferenceConfig, IO
|
||||
process.StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = SecurityConstants.EXTERNAL_INFERENCE_PATH,
|
||||
Arguments = $"--port {_inferenceClientConfig.ZeroMqPort} --loader-port {_loaderClientConfig.ZeroMqPort} --api {_inferenceClientConfig.ApiUrl}",
|
||||
Arguments = $"-p {_inferenceClientConfig.ZeroMqPort} -lp {_loaderClientConfig.ZeroMqPort} -a {_inferenceClientConfig.ApiUrl}",
|
||||
//RedirectStandardOutput = true,
|
||||
//RedirectStandardError = true,
|
||||
//CreateNoWindow = true
|
||||
@@ -51,7 +58,7 @@ public class InferenceClient(IOptions<InferenceClientConfig> inferenceConfig, IO
|
||||
|
||||
process.OutputDataReceived += (_, e) => { if (e.Data != null) Console.WriteLine(e.Data); };
|
||||
process.ErrorDataReceived += (_, e) => { if (e.Data != null) Console.WriteLine(e.Data); };
|
||||
process.Start();
|
||||
// process.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -101,7 +108,6 @@ public class InferenceClient(IOptions<InferenceClientConfig> inferenceConfig, IO
|
||||
{
|
||||
_poller.Stop();
|
||||
_poller.Dispose();
|
||||
|
||||
_dealer.SendFrame(MessagePackSerializer.Serialize(new RemoteCommand(CommandType.Exit)));
|
||||
_dealer.Disconnect($"tcp://{_inferenceClientConfig.ZeroMqHost}:{_inferenceClientConfig.ZeroMqPort}");
|
||||
_dealer.Close();
|
||||
|
||||
Reference in New Issue
Block a user