Пример #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();
 }
Пример #5
0
 /// <summary>
 /// Does shutdown work.
 /// </summary>
 public void Stop()
 {
     genericHost.Stop().GetAwaiter().GetResult();
 }