/// <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); } }
public void Dispose() { _serverRegister.Deregister(ServiceId); }