Beispiel #1
0
        public void Start()
        {
            _shutdown = false;
            PersistenceStore.EnsureStoreExists();
            QueueProvider.Start().Wait();
            LockProvider.Start().Wait();

            Logger.LogInformation("Starting backgroud tasks");

            foreach (var task in _backgroundTasks)
            {
                task.Start();
            }
        }
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            _shutdown = false;
            PersistenceStore.EnsureStoreExists();
            await QueueProvider.Start();

            await LockProvider.Start();

            await _lifeCycleEventHub.Start();

            await _searchIndex.Start();

            Logger.LogInformation("Starting background tasks");

            foreach (var task in _backgroundTasks)
            {
                task.Start();
            }
        }
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            _shutdown = false;
            PersistenceStore.EnsureStoreExists();
            await QueueProvider.Start();

            await LockProvider.Start();

            await _lifeCycleEventHub.Start();

            await _searchIndex.Start();

            // Event subscriptions are removed when stopping the event hub.
            // Add them when starting.
            AddEventSubscriptions();

            Logger.LogInformation("Starting background tasks");

            foreach (var task in _backgroundTasks)
            {
                task.Start();
            }
        }
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            var activity = WorkflowActivity.StartHost();

            try
            {
                _shutdown = false;
                PersistenceStore.EnsureStoreExists();
                await QueueProvider.Start();

                await LockProvider.Start();

                await _lifeCycleEventHub.Start();

                await _searchIndex.Start();

                // Event subscriptions are removed when stopping the event hub.
                // Add them when starting.
                AddEventSubscriptions();

                Logger.LogInformation("Starting background tasks");

                foreach (var task in _backgroundTasks)
                {
                    task.Start();
                }
            }
            catch (Exception ex)
            {
                activity.RecordException(ex);
                throw;
            }
            finally
            {
                activity?.Dispose();
            }
        }