private static async Task RunAsync(this ConsulGrpcHost host, string name, string address, int port,
                                           CancellationToken token = default(CancellationToken))
        {
            if (token.CanBeCanceled)
            {
                await host.RunAsync(name, address, port, token, null);

                return;
            }

            var done = new ManualResetEventSlim(false);

            using (var cts = new CancellationTokenSource())
            {
                AttachCtrlcSigtermShutdown(cts, done, "Application is shutting down...");
                await host.RunAsync(name, address, port, cts.Token, "Application started. Press Ctrl+C to shut down.");

                done.Set();
            }
        }
 public static void Run(this ConsulGrpcHost host, string name, string address, int port)
 {
     host.RunAsync(name, address, port).GetAwaiter().GetResult();
 }