This repository has been archived by the owner on Jul 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update packages to Orleans 2.3.0 (#30)
- Loading branch information
1 parent
96fa79f
commit a0f3be3
Showing
8 changed files
with
812 additions
and
789 deletions.
There are no files selected for viewing
157 changes: 79 additions & 78 deletions
157
src/Orleans.Clustering.CosmosDB/ClusteringExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,79 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Orleans.Clustering.CosmosDB; | ||
using Orleans.Configuration; | ||
using Orleans.Hosting; | ||
using Orleans.Messaging; | ||
using System; | ||
|
||
namespace Orleans.Hosting | ||
{ | ||
public static class ClusteringExtensions | ||
{ | ||
public static ISiloHostBuilder UseCosmosDBMembership(this ISiloHostBuilder builder, | ||
Action<CosmosDBClusteringOptions> configureOptions) | ||
{ | ||
return builder.ConfigureServices(services => services.UseCosmosDBMembership(configureOptions)); | ||
} | ||
|
||
public static ISiloHostBuilder UseCosmosDBMembership(this ISiloHostBuilder builder, | ||
Action<OptionsBuilder<CosmosDBClusteringOptions>> configureOptions) | ||
{ | ||
return builder.ConfigureServices(services => services.UseCosmosDBMembership(configureOptions)); | ||
} | ||
|
||
public static ISiloHostBuilder UseCosmosDBMembership(this ISiloHostBuilder builder) | ||
{ | ||
return builder.ConfigureServices(services => | ||
{ | ||
services.AddOptions<CosmosDBClusteringOptions>(); | ||
services.AddSingleton<IMembershipTable, CosmosDBMembershipTable>(); | ||
}); | ||
} | ||
|
||
public static IClientBuilder UseCosmosDBGatewayListProvider(this IClientBuilder builder, Action<CosmosDBGatewayOptions> configureOptions) | ||
{ | ||
return builder.ConfigureServices(services => services.UseCosmosDBGatewayListProvider(configureOptions)); | ||
} | ||
|
||
public static IClientBuilder UseCosmosDBGatewayListProvider(this IClientBuilder builder) | ||
{ | ||
return builder.ConfigureServices(services => | ||
{ | ||
services.AddOptions<CosmosDBGatewayOptions>(); | ||
services.AddSingleton<IGatewayListProvider, CosmosDBGatewayListProvider>(); | ||
}); | ||
} | ||
|
||
public static IClientBuilder UseCosmosDBGatewayListProvider(this IClientBuilder builder, Action<OptionsBuilder<CosmosDBGatewayOptions>> configureOptions) | ||
{ | ||
return builder.ConfigureServices(services => services.UseCosmosDBGatewayListProvider(configureOptions)); | ||
} | ||
|
||
public static IServiceCollection UseCosmosDBMembership(this IServiceCollection services, | ||
Action<CosmosDBClusteringOptions> configureOptions) | ||
{ | ||
return services.UseCosmosDBMembership(ob => ob.Configure(configureOptions)); | ||
} | ||
|
||
public static IServiceCollection UseCosmosDBMembership(this IServiceCollection services, | ||
Action<OptionsBuilder<CosmosDBClusteringOptions>> configureOptions) | ||
{ | ||
configureOptions?.Invoke(services.AddOptions<CosmosDBClusteringOptions>()); | ||
return services.AddSingleton<IMembershipTable, CosmosDBMembershipTable>(); | ||
} | ||
|
||
public static IServiceCollection UseCosmosDBGatewayListProvider(this IServiceCollection services, | ||
Action<CosmosDBGatewayOptions> configureOptions) | ||
{ | ||
return services.UseCosmosDBGatewayListProvider(ob => ob.Configure(configureOptions)); | ||
} | ||
|
||
public static IServiceCollection UseCosmosDBGatewayListProvider(this IServiceCollection services, | ||
Action<OptionsBuilder<CosmosDBGatewayOptions>> configureOptions) | ||
{ | ||
configureOptions?.Invoke(services.AddOptions<CosmosDBGatewayOptions>()); | ||
return services.AddSingleton<IGatewayListProvider, CosmosDBGatewayListProvider>(); | ||
} | ||
} | ||
} | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Options; | ||
using Orleans.Clustering.CosmosDB; | ||
using Orleans.Configuration; | ||
using Orleans.Hosting; | ||
using Orleans.Messaging; | ||
using System; | ||
|
||
namespace Orleans.Hosting | ||
{ | ||
public static class ClusteringExtensions | ||
{ | ||
public static ISiloHostBuilder UseCosmosDBMembership(this ISiloHostBuilder builder, | ||
Action<CosmosDBClusteringOptions> configureOptions) | ||
{ | ||
return builder.ConfigureServices(services => services.UseCosmosDBMembership(configureOptions)); | ||
} | ||
|
||
public static ISiloHostBuilder UseCosmosDBMembership(this ISiloHostBuilder builder, | ||
Action<OptionsBuilder<CosmosDBClusteringOptions>> configureOptions) | ||
{ | ||
return builder.ConfigureServices(services => services.UseCosmosDBMembership(configureOptions)); | ||
} | ||
|
||
public static ISiloHostBuilder UseCosmosDBMembership(this ISiloHostBuilder builder) | ||
{ | ||
return builder.ConfigureServices(services => | ||
{ | ||
services.AddOptions<CosmosDBClusteringOptions>(); | ||
services.AddSingleton<IMembershipTable, CosmosDBMembershipTable>(); | ||
}); | ||
} | ||
|
||
public static IClientBuilder UseCosmosDBGatewayListProvider(this IClientBuilder builder, Action<CosmosDBGatewayOptions> configureOptions) | ||
{ | ||
return builder.ConfigureServices(services => services.UseCosmosDBGatewayListProvider(configureOptions)); | ||
} | ||
|
||
public static IClientBuilder UseCosmosDBGatewayListProvider(this IClientBuilder builder) | ||
{ | ||
return builder.ConfigureServices(services => | ||
{ | ||
services.AddOptions<CosmosDBGatewayOptions>(); | ||
services.AddSingleton<IGatewayListProvider, CosmosDBGatewayListProvider>(); | ||
}); | ||
} | ||
|
||
public static IClientBuilder UseCosmosDBGatewayListProvider(this IClientBuilder builder, Action<OptionsBuilder<CosmosDBGatewayOptions>> configureOptions) | ||
{ | ||
return builder.ConfigureServices(services => services.UseCosmosDBGatewayListProvider(configureOptions)); | ||
} | ||
|
||
public static IServiceCollection UseCosmosDBMembership(this IServiceCollection services, | ||
Action<CosmosDBClusteringOptions> configureOptions) | ||
{ | ||
return services.UseCosmosDBMembership(ob => ob.Configure(configureOptions)); | ||
} | ||
|
||
public static IServiceCollection UseCosmosDBMembership(this IServiceCollection services, | ||
Action<OptionsBuilder<CosmosDBClusteringOptions>> configureOptions) | ||
{ | ||
configureOptions?.Invoke(services.AddOptions<CosmosDBClusteringOptions>()); | ||
return services.AddSingleton<IMembershipTable, CosmosDBMembershipTable>(); | ||
} | ||
|
||
public static IServiceCollection UseCosmosDBGatewayListProvider(this IServiceCollection services, | ||
Action<CosmosDBGatewayOptions> configureOptions) | ||
{ | ||
return services.UseCosmosDBGatewayListProvider(ob => ob.Configure(configureOptions)); | ||
} | ||
|
||
public static IServiceCollection UseCosmosDBGatewayListProvider(this IServiceCollection services, | ||
Action<OptionsBuilder<CosmosDBGatewayOptions>> configureOptions) | ||
{ | ||
configureOptions?.Invoke(services.AddOptions<CosmosDBGatewayOptions>()); | ||
return services.AddSingleton<IGatewayListProvider, CosmosDBGatewayListProvider>(); | ||
} | ||
} | ||
} |
Oops, something went wrong.