Grpc.Core.GrpcEnvironment.KillServersAsync C# (CSharp) Method

KillServersAsync() public static method

Requests immediate shutdown of all servers created by the current process.
public static KillServersAsync ( ) : Task
return Task
        public static Task KillServersAsync()
        {
            HashSet<Server> snapshot = null;
            lock (staticLock)
            {
                snapshot = new HashSet<Server>(registeredServers);
            }
            return Task.WhenAll(snapshot.Select((server) => server.KillAsync()));
        }

Usage Example

Beispiel #1
0
 /// <summary>
 /// Handler for AppDomain.DomainUnload, AppDomain.ProcessExit and AssemblyLoadContext.Unloading hooks.
 /// </summary>
 private static void HandleShutdown()
 {
     Task.WaitAll(GrpcEnvironment.ShutdownChannelsAsync(), GrpcEnvironment.KillServersAsync());
 }
All Usage Examples Of Grpc.Core.GrpcEnvironment::KillServersAsync