示例#1
0
 /// <summary>
 /// Does shutdown work.
 /// </summary>
 public void Stop()
 {
     try
     {
         genericHost.Stop().GetAwaiter().GetResult();
     }
     catch (Exception ex)
     {
         Log.Fatal("Stop failure", ex);
         Environment.Exit(-2);
     }
 }
示例#2
0
 /// <summary>
 /// Does shutdown work.
 /// </summary>
 public void Stop()
 {
     try
     {
         genericHost.Stop().GetAwaiter().GetResult();
     }
     catch (Exception exception)
     {
         var log = LogManager.GetLogger <WindowsHost>(); // Defers logger creation to allow custom logging configuration
         log.Fatal("Stop failure", exception);
         Environment.Exit(-2);
     }
 }
示例#3
0
        static async Task <IWantToRunContext> RunHost()
        {
            var defaultProfiles = new List <Type>
            {
                typeof(Production)
            };

            string[] args = {};

            var context    = new IWantToRunContext();
            var configurer = new GenericEndpointConfig(context);
            var host       = new GenericHost(configurer, args, defaultProfiles, GenericEndpointConfig.EndpointName);

            await host.Start();

            await host.Stop();

            return(context);
        }
示例#4
0
 /// <summary>
 /// Does shutdown work.
 /// </summary>
 public void Stop()
 {
     genericHost.Stop();
 }
 /// <summary>
 /// Does shutdown work.
 /// </summary>
 public void Stop()
 {
     genericHost.Stop().GetAwaiter().GetResult();
 }