예제 #1
0
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            // SystemTarget for provider init calls
            this.lifecycleSchedulingSystemTarget = Services.GetRequiredService <LifecycleSchedulingSystemTarget>();
            this.fallbackScheduler = Services.GetRequiredService <FallbackSystemTarget>();
            RegisterSystemTarget(lifecycleSchedulingSystemTarget);

            try
            {
                await this.scheduler.QueueTask(() => this.siloLifecycle.OnStart(cancellationToken), this.lifecycleSchedulingSystemTarget.SchedulingContext);
            }
            catch (Exception exc)
            {
                logger.Error(ErrorCode.SiloStartError, "Exception during Silo.Start", exc);
                throw;
            }
        }
예제 #2
0
파일: Silo.cs 프로젝트: wmhang/orleans
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            StartTaskWithPerfAnalysis("Start Scheduler", scheduler.Start, new Stopwatch());

            // SystemTarget for provider init calls
            this.lifecycleSchedulingSystemTarget = Services.GetRequiredService <LifecycleSchedulingSystemTarget>();
            this.fallbackScheduler = Services.GetRequiredService <FallbackSystemTarget>();
            RegisterSystemTarget(lifecycleSchedulingSystemTarget);

            try
            {
                await this.scheduler.QueueTask(() => this.siloLifecycle.OnStart(cancellationToken), this.lifecycleSchedulingSystemTarget.SchedulingContext);

                this.logger.LogInformation((int)ErrorCode.SiloStarted, "Silo started");
            }
            catch (Exception exc)
            {
                logger.Error(ErrorCode.SiloStartError, "Exception during Silo.Start", exc);
                throw;
            }
        }