コード例 #1
0
        public void RegisterGrainService(IGrainService service)
        {
            var type = ((ISystemTargetBase)service).GrainId.Type;
            var name = service.GetType().FullName;

            this.grainServicesNames.Add(type, name);
        }
コード例 #2
0
        private async Task StartGrainService(IGrainService service)
        {
            var grainService = (GrainService)service;

            await this.scheduler.QueueTask(grainService.Start, grainService.SchedulingContext).WithTimeout(this.initTimeout, $"Starting GrainService failed due to timeout {initTimeout}");

            logger.Info($"Grain Service {service.GetType().FullName} started successfully.");
        }
コード例 #3
0
ファイル: Silo.cs プロジェクト: dotnet/orleans
        private async Task StartGrainService(IGrainService service)
        {
            var grainService = (GrainService)service;

            await grainService.QueueTask(grainService.Start).WithTimeout(this.initTimeout, $"Starting GrainService failed due to timeout {initTimeout}");

            logger.LogInformation("Grain Service {GrainServiceType} started successfully.", service.GetType().FullName);
        }
コード例 #4
0
        private async Task RegisterGrainService(IGrainService service)
        {
            var grainService = (GrainService)service;

            RegisterSystemTarget(grainService);
            grainServices.Add(grainService);

            await this.scheduler.QueueTask(() => grainService.Init(Services), grainService.SchedulingContext).WithTimeout(this.initTimeout, $"GrainService Initializing failed due to timeout {initTimeout}");

            logger.Info($"Grain Service {service.GetType().FullName} registered successfully.");
        }
コード例 #5
0
ファイル: Silo.cs プロジェクト: dotnet/orleans
        private async Task RegisterGrainService(IGrainService service)
        {
            var grainService = (GrainService)service;

            RegisterSystemTarget(grainService);
            grainServices.Add(grainService);

            await grainService.QueueTask(() => grainService.Init(Services)).WithTimeout(this.initTimeout, $"GrainService Initializing failed due to timeout {initTimeout}");

            logger.LogInformation(
                "Grain Service {GrainServiceType} registered successfully.",
                service.GetType().FullName);
        }
コード例 #6
0
        private async Task StopGrainService(IGrainService service, CancellationToken ct)
        {
            var grainService = (GrainService)service;

            await this.scheduler
            .QueueTask(grainService.Stop, grainService.SchedulingContext)
            .WithCancellation(ct, "Stopping GrainService failed because the task was cancelled");

            if (this.logger.IsEnabled(LogLevel.Debug))
            {
                logger.Debug(
                    "{GrainServiceType} Grain Service with Id {GrainServiceId} stopped successfully.",
                    grainService.GetType().FullName,
                    grainService.GetPrimaryKeyLong(out string ignored));
            }
        }
コード例 #7
0
 public async Task AddGrainService(IGrainService service)
 {
     await RegisterGrainService(service);
     await StartGrainService(service);
 }
コード例 #8
0
 public GrainRepository(IGrainService service)
 {
     _service = service;
 }