public void Configure(ISiloBuilder hostBuilder) { hostBuilder .AddEventHubStreams(StreamBatchingTestConst.ProviderName, b => { b.ConfigureEventHub(ob => ob.Configure(options => { options.ConfigureTestDefaults(); options.ConsumerGroup = EHConsumerGroup; options.Path = EHPath; })); b.UseAzureTableCheckpointer(ob => ob.Configure(options => { options.ConnectionString = TestDefaultConfiguration.DataConnectionString; options.PersistInterval = TimeSpan.FromSeconds(1); })); b.UseDynamicClusterConfigDeploymentBalancer(); b.ConfigurePullingAgent(ob => ob.Configure(options => { options.BatchContainerBatchSize = 10; })); b.ConfigureStreamPubSub(StreamPubSubType.ImplicitOnly); }); hostBuilder .AddMemoryGrainStorageAsDefault(); }
public void Configure(ISiloBuilder builder) { //get the redis connection string from the testcluster's config var redisEP = builder.GetConfigurationValue("RedisConnectionString"); builder.AddMemoryGrainStorageAsDefault(); builder.AddRedisGrainStorage("REDIS-JSON", optionsBuilder => optionsBuilder.Configure(options => { options.UseJson = true; options.ConnectionString = redisEP; })); builder.AddRedisGrainStorage("REDIS-BINARY", optionsBuilder => optionsBuilder.Configure(options => { options.UseJson = false; options.ConnectionString = redisEP; })); builder.AddRedisGrainStorage("PubSubStore", optionsBuilder => optionsBuilder.Configure(options => { options.UseJson = false; options.ConnectionString = redisEP; })); builder.AddSimpleMessageStreamProvider("SMSProvider"); }
private static void ConfigureStorage(ISiloBuilder siloBuilder, IConfiguration configuration) { if (configuration.GetValue("StorageMode", "memory") == "memory") { siloBuilder.AddMemoryGrainStorageAsDefault(); } }
private static void ConfigureStorage(ISiloBuilder siloBuilder) { siloBuilder.AddMemoryGrainStorageAsDefault(); siloBuilder.ConfigureServices(services => { services.AddSingletonNamedService <IGrainStorage, UserStateGrainStorage>("UserState"); }); }
public void Configure(ISiloBuilder hostBuilder) { Configuration = hostBuilder.GetConfiguration(); hostBuilder .AddMemoryGrainStorageAsDefault() .UseLocalhostClustering() .ConfigureApplicationParts(parts => parts.AddFromApplicationBaseDirectory()); }
public void Configure(ISiloBuilder hostBuilder) { hostBuilder .AddMemoryGrainStorageAsDefault() .AddMemoryGrainStorage("MemoryStore") .AddPersistentStreams(StreamProviderName, GeneratorAdapterFactory.Create, b => { b.ConfigureStreamPubSub(StreamPubSubType.ImplicitOnly); b.Configure <HashRingStreamQueueMapperOptions>(ob => ob.Configure(options => options.TotalQueueCount = TotalQueueCount)); b.UseDynamicClusterConfigDeploymentBalancer(); }); }
public void Configure(ISiloBuilder hostBuilder) { hostBuilder .AddAzureQueueStreams(StreamProviderName2, ob => ob.Configure <IOptions <ClusterOptions> >( (options, dep) => { options.ConfigureTestDefaults(); options.QueueNames = AzureQueueUtilities.GenerateQueueNames($"{dep.Value.ClusterId}2", queueCount); })) .AddAzureQueueStreams(StreamProviderName, ob => ob.Configure <IOptions <ClusterOptions> >( (options, dep) => { options.ConfigureTestDefaults(); options.QueueNames = AzureQueueUtilities.GenerateQueueNames(dep.Value.ClusterId, queueCount); })); hostBuilder .AddMemoryGrainStorageAsDefault() .AddMemoryGrainStorage("PubSubStore"); }
public static ISiloBuilder UseAppConfiguration(this ISiloBuilder siloHost, AppSiloBuilderContext context) { _defaultProviderType = context.SiloOptions.StorageProviderType ?? StorageProviderType.Memory; var appInfo = context.AppInfo; siloHost .AddMemoryGrainStorageAsDefault() .Configure <ClusterOptions>(options => { options.ClusterId = appInfo.ClusterId; options.ServiceId = appInfo.Name; }); siloHost.UseDevelopment(context); siloHost.UseDevelopmentClustering(context); return(siloHost); }
public void Configure(ISiloBuilder hostBuilder) { hostBuilder .AddEventHubStreams(StreamProviderName, b => { b.ConfigureEventHub(ob => ob.Configure(options => { options.ConfigureTestDefaults(EHPath, EHConsumerGroup); })); b.UseAzureTableCheckpointer(ob => ob.Configure(options => { options.ConfigureTableServiceClient(TestDefaultConfiguration.DataConnectionString); options.PersistInterval = TimeSpan.FromSeconds(1); })); b.UseDynamicClusterConfigDeploymentBalancer(); b.ConfigureStreamPubSub(StreamPubSubType.ImplicitOnly); }); hostBuilder .AddMemoryGrainStorageAsDefault(); }
public void Configure(ISiloBuilder siloBuilder) { siloBuilder.AddSimpleMessageStreamProvider("SMS2"); siloBuilder.AddMemoryGrainStorageAsDefault(); siloBuilder.AddMemoryGrainStorage("PubSubStore"); siloBuilder.AddStartupTask((provider, token) => { // expose the silo service providers to the running test if (TestContext.ServiceProviders != null) { TestContext.ServiceProviders.Value.TryAdd(provider, true); provider.GetRequiredService <Silo>().SiloTerminated.ContinueWith(x => { TestContext.ServiceProviders.Value.TryRemove(provider, out _); }); } return(Task.CompletedTask); }); }
public void Configure(ISiloBuilder hostBuilder) { hostBuilder.AddMemoryGrainStorageAsDefault(); }
/// <summary> /// Configure silo to use memory grain storage as the default grain storage. /// </summary> public static ISiloBuilder AddMemoryGrainStorageAsDefault(this ISiloBuilder builder, Action <MemoryGrainStorageOptions> configureOptions) { return(builder.AddMemoryGrainStorageAsDefault(ob => ob.Configure(configureOptions))); }