Beispiel #1
0
 public static ISiloBuilder AddTestGrainService(this ISiloBuilder builder, string configProperty)
 {
     return(builder.AddGrainService <TestGrainService>()
            .ConfigureServices(services => services
                               .AddSingleton <ITestGrainServiceClient, TestGrainServiceClient>()
                               .AddOptions <TestGrainServiceOptions>().Configure(o => o.ConfigProperty = configProperty)));
 }
        public static ISiloBuilder AddLocalPinnedGrain <TPinnedGrain>(this ISiloBuilder hostBuilder)
            where TPinnedGrain : ILocalPinnedGrain
        {
            if (!hostBuilder.Properties.ContainsKey(GrainPinnerPropertyName))
            {
                hostBuilder.AddGrainService <LocalGrainPinner>();
                hostBuilder.Properties[GrainPinnerPropertyName] = true;
            }

            hostBuilder.Configure <LocalPinOptions>(opt => opt.AddLocalPinnedGrain <TPinnedGrain>());
            return(hostBuilder);
        }
        public static ISiloBuilder AddJobFacSchedulingServices(this ISiloBuilder builder)
        {
            builder

            .AddGrainService <SchedulerService>()

            .ConfigureApplicationParts(parts =>
            {
                parts.AddApplicationPart(typeof(ISchedulerQueue).Assembly).WithReferences();
                parts.AddApplicationPart(typeof(ISchedulerService).Assembly).WithReferences();
                parts.AddApplicationPart(typeof(IScheduledExecution).Assembly).WithReferences();
                parts.AddApplicationPart(typeof(IScheduleWriter).Assembly).WithReferences();
                parts.AddApplicationPart(typeof(SchedulerQueue).Assembly).WithReferences();
                parts.AddApplicationPart(typeof(SchedulerService).Assembly).WithReferences();
                parts.AddApplicationPart(typeof(ScheduledExecution).Assembly).WithReferences();
                parts.AddApplicationPart(typeof(ScheduleWriter).Assembly).WithReferences();
            });
            return(builder);
        }