/// <summary>
 /// Grpc服务停止
 /// </summary>
 /// <param name="whenException">==null => throw</param>
 public static void Stop(Action <Exception> whenException = null)
 {
     try
     {
         serverRegister?.Deregister(discoveryEntry?.ServiceId);
         server?.ShutdownAsync().Wait();
     }
     catch (Exception ex)
     {
         InvokeException(ex, whenException);
     }
 }
Exemple #2
0
 public void Dispose()
 {
     _serverRegister.Deregister(ServiceId);
 }