Пример #1
0
        internal async Task <IReminderService> CreateReminderService(Silo silo)
        {
            var reminderServiceType = silo.GlobalConfig.ReminderServiceType;

            logger.Info("Creating reminder system target for type={0}", Enum.GetName(typeof(GlobalConfiguration.ReminderServiceProviderType), reminderServiceType));

            await ReminderTable.Initialize(silo);

            return(new LocalReminderService(silo.SiloAddress, Constants.ReminderServiceId, silo.RingProvider, silo.LocalScheduler, ReminderTable.Singleton));
        }
Пример #2
0
        internal IReminderService CreateReminderService(Silo silo, IGrainFactory grainFactory, TimeSpan iniTimeSpan)
        {
            var reminderServiceType = silo.GlobalConfig.ReminderServiceType;

            logger.Info("Creating reminder system target for type={0}", Enum.GetName(typeof(GlobalConfiguration.ReminderServiceProviderType), reminderServiceType));

            ReminderTable.Initialize(silo, grainFactory, silo.GlobalConfig.ReminderTableAssembly);
            return(new LocalReminderService(
                       silo.SiloAddress,
                       Constants.ReminderServiceId,
                       silo.RingProvider,
                       silo.LocalScheduler,
                       ReminderTable.Singleton,
                       silo.GlobalConfig,
                       iniTimeSpan));
        }
        internal IReminderService CreateReminderService(Silo silo, IGrainFactory grainFactory, TimeSpan iniTimeSpan, ISiloRuntimeClient runtimeClient)
        {
            var reminderServiceType = silo.GlobalConfig.ReminderServiceType;

            logger.Info("Creating reminder grain service for type={0}", Enum.GetName(typeof(GlobalConfiguration.ReminderServiceProviderType), reminderServiceType));

            // GrainInterfaceMap only holds IGrain types, not ISystemTarget types, so resolved via Orleans.CodeGeneration.
            // Resolve this before merge.
            var typeCode = GrainInterfaceUtils.GetGrainClassTypeCode(typeof(IReminderService));
            var grainId  = GrainId.GetGrainServiceGrainId(0, typeCode);

            ReminderTable.Initialize(silo, grainFactory, silo.GlobalConfig.ReminderTableAssembly);
            return(new LocalReminderService(
                       silo,
                       grainId,
                       ReminderTable.Singleton,
                       silo.GlobalConfig,
                       iniTimeSpan));
        }