Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; // Catch any unhandled exceptions if we are in release mode.

            ConsoleExtensions.PrintBanner();                                         // print banner.
            ConsoleExtensions.PrintLicense();                                        // print license.

            var bootstrapper = new Bootstrapper();                                   // IoC kernel bootstrapper.

            bootstrapper.Run();                                                      // run bootstrapper.

            var coreFactory = bootstrapper.Container.Resolve <ICoreFactory>();       // get core object factory.
            var engine      = coreFactory.GetEngine();                               // get engine.

            // create logger to be used later.
            _logger = Log.ForContext <Program>();

            _logger.Information($"hypepool warming-up: v{Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion}");
            _logger.Information($"running on {RuntimeInfo.OperatingSystem.Name}-{RuntimeInformation.ProcessArchitecture.ToString().ToLower()}");
            _logger.Information($"os: {RuntimeInformation.OSDescription}");
            _logger.Information($"dotnet core: {RuntimeInfo.DotNetCoreVersion}, framework: {RuntimeInformation.FrameworkDescription}");
            _logger.Information($"running over {Environment.ProcessorCount} core system");

            engine.Start();

            while (true)
            {
            }
        }