Abc.Zebus.TinyHost.Host.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
        public void Start()
        {
            try
            {
                _logger.Info("Zebus Host is starting...");
                _logger.Info($"User: {Environment.UserName}");
                _logger.Info($"PID: {Process.GetCurrentProcess().Id}");

                _container = ContainerFactory.Invoke();

                _bus = _container.GetInstance<IBus>();

                _container.CallActionOnInitializers(x => x.ConfigureContainer(_container));

                ConfigureBus();

                _container.CallActionOnInitializers(x => x.BeforeStart());

                _logger.Info("Starting bus");
                _bus.Start();

                _container.CallActionOnInitializers(x => x.AfterStart());

                _logger.Info("Zebus Host started"); 
            }
            catch (Exception ex)
            {
                _logger.Error(ex);

                if (_bus != null && _bus.IsRunning)
                    StopBus();

                throw;
            }
        }