public void RegisterGrainService(IGrainService service) { var type = ((ISystemTargetBase)service).GrainId.Type; var name = service.GetType().FullName; this.grainServicesNames.Add(type, name); }
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."); }
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); }
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."); }
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); }
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)); } }
public async Task AddGrainService(IGrainService service) { await RegisterGrainService(service); await StartGrainService(service); }
public GrainRepository(IGrainService service) { _service = service; }