static void Main(string[] args)
        {
            var loggingConfig = LoggingConfiguration.ConfigureLogger();

            HostFactory.Run(cfg =>
            {
                var container = Initialise();

                cfg.UseSerilog(loggingConfig);
                cfg.UseAutofacContainer(container);

                cfg.Service <PomaxPumpService>(s =>
                {
                    s.ConstructUsingAutofacContainer();
                    s.WhenStarted((service, control) => service.Start(control));
                    s.WhenStopped((service, control) => service.Stop(control));
                });

                cfg.RunAsLocalService();
                cfg.SetDisplayName("Pomax Pump");
                cfg.SetDescription("This service sends trades to the Pomax Pump.");

                cfg.OnException(ex =>
                {
                    Log.Fatal(ex, "Encountered unhandled exception (bubbled to Topshelf)");
                });
            });
        }
Exemple #2
0
        static void Main()
        {
            var loggingConfig = LoggingConfiguration.ConfigureLogger("StateSaga");

            HostFactory.Run(cfg =>
            {
                var container = Initialise();

                cfg.UseSerilog(loggingConfig);
                cfg.UseAutofacContainer(container);

                cfg.Service <SagaStateService>(s =>
                {
                    s.ConstructUsingAutofacContainer();
                    s.WhenStarted((service, control) => service.Start(control));
                    s.WhenStopped((service, control) => service.Stop(control));
                });

                cfg.RunAsLocalService();
                cfg.SetDisplayName("State Saga Service");
                cfg.SetDescription("This service facilitates the handling of state in The Book.");

                cfg.OnException(ex =>
                {
                    Log.Fatal(ex, "Encountered unhandled exception (bubbled to Topshelf)");
                });
            });
        }
Exemple #3
0
        static void Main()
        {
            var loggingConfig = LoggingConfiguration.ConfigureLogger();

            HostFactory.Run(cfg =>
            {
                var container = Initialise();

                cfg.UseSerilog(loggingConfig);
                cfg.UseAutofacContainer(container);

                cfg.Service <TradeCaptureService>(s =>
                {
                    s.ConstructUsingAutofacContainer();
                    s.WhenStarted((service, control) => service.Start(control));
                    s.WhenStopped((service, control) => service.Stop(control));
                });

                cfg.RunAsLocalService();
                cfg.SetDisplayName("Validation Service");
                cfg.SetDescription("This service handles trades from the trade capture clients.");

                cfg.OnException(ex =>
                {
                    Log.Fatal(ex, "Encountered unhandled exception (bubbled to Topshelf)");
                });
            });
        }
Exemple #4
0
        public static void Main(string[] args)
        {
            LoggingConfiguration.ConfigureLogger("StateSaga");

            var bus = ConfigureBus();

            bus.Start();
            CreateWebHostBuilder(args).Build().Run();
        }
Exemple #5
0
        public static void Main(string[] args)
        {
            var logger = LoggingConfiguration.ConfigureLogger("PricingProxy");

            LogContext.ConfigureCurrentLogContext(new SerilogLoggerFactory(logger));

            var bus = ConfigureBus();

            bus.Start();
            CreateWebHostBuilder(args).Build().Run();
        }
Exemple #6
0
        public static void Main(string[] args)
        {
            LoggingConfiguration.ConfigureLogger("BackendForFrontend");

            CreateWebHostBuilder(args).Build().Run();
        }