From a1e395d946ac6ff0fa06d1175fc6bd2c78a7e936 Mon Sep 17 00:00:00 2001 From: Yevhen Bobrov Date: Sat, 31 Mar 2018 19:14:10 +0300 Subject: [PATCH] Update to Orleans 2.0 final --- Directory.Build.props | 8 ++++---- Samples/CSharp/Observers/Chat.Client/Program.cs | 4 +++- Samples/CSharp/Observers/Chat.Server/Program.cs | 2 +- Samples/CSharp/Shared.cs | 6 +++--- Samples/CSharp/Streams/Chat.Client/Program.cs | 3 ++- Samples/CSharp/Streams/Chat.Server/Program.cs | 2 +- Samples/FSharp/Shared.fs | 10 +++++----- Samples/FSharp/Streams/Chat.Client/Program.fs | 3 +-- Samples/FSharp/Streams/Chat.Server/Program.fs | 6 +++--- Source/Orleankka.TestKit/MessageSerialization.cs | 2 +- Tests/Orleankka.Tests/Testing/TestActions.cs | 6 +++--- 11 files changed, 27 insertions(+), 25 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index da1446fd..9b309916 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -45,10 +45,10 @@ - 2.0.0-rc1 - 2.0.0-rc1 - 2.0.0-rc1 - 2.0.0-rc1 + 2.0.0 + 2.0.0 + 2.0.0 + 2.0.0 3.9.0 diff --git a/Samples/CSharp/Observers/Chat.Client/Program.cs b/Samples/CSharp/Observers/Chat.Client/Program.cs index e9ee89f4..580b7429 100644 --- a/Samples/CSharp/Observers/Chat.Client/Program.cs +++ b/Samples/CSharp/Observers/Chat.Client/Program.cs @@ -5,6 +5,8 @@ using Orleans; using Orleans.Hosting; using Orleans.Runtime; +using Orleans.Configuration; + using Orleankka.Client; namespace Example @@ -60,7 +62,7 @@ static async Task Connect(int retries = 0, TimeSpan? retryTi try { var client = new ClientBuilder() - .ConfigureCluster(options => options.ClusterId = DemoClusterId) + .Configure(options => options.ClusterId = DemoClusterId) .UseStaticClustering(options => options.Gateways.Add(new IPEndPoint(LocalhostSiloAddress, LocalhostGatewayPort).ToGatewayUri())) .ConfigureApplicationParts(x => x .AddApplicationPart(typeof(Join).Assembly) diff --git a/Samples/CSharp/Observers/Chat.Server/Program.cs b/Samples/CSharp/Observers/Chat.Server/Program.cs index dbadb056..97523c30 100644 --- a/Samples/CSharp/Observers/Chat.Server/Program.cs +++ b/Samples/CSharp/Observers/Chat.Server/Program.cs @@ -23,7 +23,7 @@ static async Task Main(string[] args) Console.WriteLine("Running demo. Booting cluster might take some time ...\n"); var host = new SiloHostBuilder() - .Configure(options => options.ClusterId = DemoClusterId) + .Configure(options => options.ClusterId = DemoClusterId) .UseDevelopmentClustering(options => options.PrimarySiloEndpoint = new IPEndPoint(LocalhostSiloAddress, LocalhostSiloPort)) .ConfigureEndpoints(LocalhostSiloAddress, LocalhostSiloPort, LocalhostGatewayPort) .ConfigureApplicationParts(x => x diff --git a/Samples/CSharp/Shared.cs b/Samples/CSharp/Shared.cs index bf04fb48..4d1186f4 100644 --- a/Samples/CSharp/Shared.cs +++ b/Samples/CSharp/Shared.cs @@ -25,12 +25,12 @@ static class DemoExtensions static readonly IPAddress LocalhostSiloAddress = IPAddress.Loopback; static ISiloHostBuilder ConfigureDemoClustering(this ISiloHostBuilder builder) => builder - .Configure(options => options.ClusterId = DemoClusterId) + .Configure(options => options.ClusterId = DemoClusterId) .UseDevelopmentClustering(options => options.PrimarySiloEndpoint = new IPEndPoint(LocalhostSiloAddress, LocalhostSiloPort)) .ConfigureEndpoints(LocalhostSiloAddress, LocalhostSiloPort, LocalhostGatewayPort); static IClientBuilder ConfigureDemoClustering(this IClientBuilder builder) => builder - .ConfigureCluster(options => options.ClusterId = DemoClusterId) + .Configure(options => options.ClusterId = DemoClusterId) .UseStaticClustering(options => options.Gateways.Add(new IPEndPoint(LocalhostSiloAddress, LocalhostGatewayPort).ToGatewayUri())); public static async Task Start(this ISiloHostBuilder builder) @@ -41,7 +41,7 @@ public static async Task Start(this ISiloHostBuilder builder) .AddMemoryGrainStorage("PubSubStore") .AddSimpleMessageStreamProvider("sms") .ConfigureApplicationParts(x => x.AddApplicationPart(typeof(MemoryGrainStorage).Assembly)) - .ConfigureServices(services => services.UseInMemoryReminderService()) + .UseInMemoryReminderService() .Build(); await host.StartAsync(); diff --git a/Samples/CSharp/Streams/Chat.Client/Program.cs b/Samples/CSharp/Streams/Chat.Client/Program.cs index d35911a3..34e6c160 100644 --- a/Samples/CSharp/Streams/Chat.Client/Program.cs +++ b/Samples/CSharp/Streams/Chat.Client/Program.cs @@ -7,6 +7,7 @@ using Orleans; using Orleans.Hosting; using Orleans.Runtime; +using Orleans.Configuration; using Orleankka.Client; @@ -72,7 +73,7 @@ static async Task Connect(int retries = 0, TimeSpan? retryTi try { var client = new ClientBuilder() - .ConfigureCluster(options => options.ClusterId = DemoClusterId) + .Configure(options => options.ClusterId = DemoClusterId) .UseStaticClustering(options => options.Gateways.Add(new IPEndPoint(LocalhostSiloAddress, LocalhostGatewayPort).ToGatewayUri())) .AddSimpleMessageStreamProvider("sms") .ConfigureServices(x => x diff --git a/Samples/CSharp/Streams/Chat.Server/Program.cs b/Samples/CSharp/Streams/Chat.Server/Program.cs index 287e5a8b..2c61850f 100644 --- a/Samples/CSharp/Streams/Chat.Server/Program.cs +++ b/Samples/CSharp/Streams/Chat.Server/Program.cs @@ -24,7 +24,7 @@ static async Task Main(string[] args) Console.WriteLine("Running demo. Booting cluster might take some time ...\n"); var host = new SiloHostBuilder() - .Configure(options => options.ClusterId = DemoClusterId) + .Configure(options => options.ClusterId = DemoClusterId) .UseDevelopmentClustering(options => options.PrimarySiloEndpoint = new IPEndPoint(LocalhostSiloAddress, LocalhostSiloPort)) .ConfigureEndpoints(LocalhostSiloAddress, LocalhostSiloPort, LocalhostGatewayPort) .AddMemoryGrainStorage("PubSubStore") diff --git a/Samples/FSharp/Shared.fs b/Samples/FSharp/Shared.fs index beba4ef8..e62d51e9 100644 --- a/Samples/FSharp/Shared.fs +++ b/Samples/FSharp/Shared.fs @@ -26,8 +26,8 @@ module Shared = type ISiloHostBuilder with member sb.ConfigureDemoClustering() = - sb.Configure(fun options -> options.ClusterId <- DemoClusterId) |> ignore - sb.UseDevelopmentClustering(fun (options:DevelopmentMembershipOptions) -> options.PrimarySiloEndpoint <- IPEndPoint(LocalhostSiloAddress, LocalhostSiloPort)) |> ignore + sb.Configure(fun (options:ClusterOptions) -> options.ClusterId <- DemoClusterId) |> ignore + sb.UseDevelopmentClustering(fun (options:DevelopmentClusterMembershipOptions) -> options.PrimarySiloEndpoint <- IPEndPoint(LocalhostSiloAddress, LocalhostSiloPort)) |> ignore sb.ConfigureEndpoints(LocalhostSiloAddress, LocalhostSiloPort, LocalhostGatewayPort) |> ignore member sb.AddAssembly(assembly:Assembly) = @@ -39,10 +39,10 @@ module Shared = sb.AddMemoryGrainStorageAsDefault() |> ignore sb.AddMemoryGrainStorage("PubSubStore") |> ignore sb.AddSimpleMessageStreamProvider("sms") |> ignore + sb.UseInMemoryReminderService() |> ignore sb.ConfigureApplicationParts(fun x -> x.AddApplicationPart(typeof.Assembly) |> ignore) |> ignore - sb.ConfigureServices(fun (services:IServiceCollection) -> services.UseInMemoryReminderService() |> ignore) |> ignore - + task { let host = sb.Build() do! host.StartAsync() @@ -52,7 +52,7 @@ module Shared = type IClientBuilder with member cb.ConfigureDemoClustering() = - cb.ConfigureCluster(fun (options:ClusterOptions) -> options.ClusterId <- DemoClusterId) |> ignore + cb.Configure(fun (options:ClusterOptions) -> options.ClusterId <- DemoClusterId) |> ignore cb.UseStaticClustering(fun (options:StaticGatewayListProviderOptions) -> options.Gateways.Add(IPEndPoint(LocalhostSiloAddress, LocalhostGatewayPort).ToGatewayUri())) |> ignore member cb.AddAssembly(assembly:Assembly) = diff --git a/Samples/FSharp/Streams/Chat.Client/Program.fs b/Samples/FSharp/Streams/Chat.Client/Program.fs index 3109f310..d21d4b98 100644 --- a/Samples/FSharp/Streams/Chat.Client/Program.fs +++ b/Samples/FSharp/Streams/Chat.Client/Program.fs @@ -2,7 +2,6 @@ open System open System.Net -open System.Diagnostics open FSharp.Control.Tasks open Orleankka @@ -54,7 +53,7 @@ let main argv = Console.ReadLine() |> ignore let cb = new ClientBuilder() - cb.ConfigureCluster(fun (options:ClusterOptions) -> options.ClusterId <- DemoClusterId) |> ignore + cb.Configure(fun (options:ClusterOptions) -> options.ClusterId <- DemoClusterId) |> ignore cb.UseStaticClustering(fun (options:StaticGatewayListProviderOptions) -> options.Gateways.Add(IPEndPoint(LocalhostSiloAddress, LocalhostGatewayPort).ToGatewayUri())) |> ignore cb.AddSimpleMessageStreamProvider("sms") |> ignore cb.ConfigureApplicationParts(fun x -> x.AddApplicationPart(typeof.Assembly).WithCodeGeneration() |> ignore) |> ignore diff --git a/Samples/FSharp/Streams/Chat.Server/Program.fs b/Samples/FSharp/Streams/Chat.Server/Program.fs index 43d8aab1..48d519a1 100644 --- a/Samples/FSharp/Streams/Chat.Server/Program.fs +++ b/Samples/FSharp/Streams/Chat.Server/Program.fs @@ -28,16 +28,16 @@ let main argv = apm.AddApplicationPart(Assembly.GetExecutingAssembly()).WithCodeGeneration() |> ignore let sb = SiloHostBuilder() - sb.Configure(fun options -> options.ClusterId <- DemoClusterId) |> ignore - sb.UseDevelopmentClustering(fun (options:DevelopmentMembershipOptions) -> options.PrimarySiloEndpoint <- IPEndPoint(LocalhostSiloAddress, LocalhostSiloPort)) |> ignore + sb.Configure(fun (options:ClusterOptions) -> options.ClusterId <- DemoClusterId) |> ignore + sb.UseDevelopmentClustering(fun (options:DevelopmentClusterMembershipOptions) -> options.PrimarySiloEndpoint <- IPEndPoint(LocalhostSiloAddress, LocalhostSiloPort)) |> ignore sb.ConfigureEndpoints(LocalhostSiloAddress, LocalhostSiloPort, LocalhostGatewayPort) |> ignore sb.AddMemoryGrainStorageAsDefault() |> ignore sb.AddMemoryGrainStorage("PubSubStore") |> ignore sb.AddSimpleMessageStreamProvider("sms") |> ignore + sb.UseInMemoryReminderService() |> ignore sb.ConfigureApplicationParts(fun x -> configureAssemblies x) |> ignore - sb.ConfigureServices(fun (services:IServiceCollection) -> services.UseInMemoryReminderService() |> ignore) |> ignore sb.ConfigureOrleankka() |> ignore use host = sb.Build() diff --git a/Source/Orleankka.TestKit/MessageSerialization.cs b/Source/Orleankka.TestKit/MessageSerialization.cs index f7982526..a69aab2c 100644 --- a/Source/Orleankka.TestKit/MessageSerialization.cs +++ b/Source/Orleankka.TestKit/MessageSerialization.cs @@ -28,7 +28,7 @@ public MessageSerialization(bool roundtrip, params Type[] serializers) return; var builder = new ClientBuilder() - .ConfigureCluster(x => x.ClusterId = "test") + .Configure(x => x.ClusterId = "test") .UseStaticClustering(x => x.Gateways.Add(new IPEndPoint(0, 0).ToGatewayUri())) .ConfigureApplicationParts(apm => apm.AddFromAppDomain()); diff --git a/Tests/Orleankka.Tests/Testing/TestActions.cs b/Tests/Orleankka.Tests/Testing/TestActions.cs index 6d0e3f55..42350a52 100644 --- a/Tests/Orleankka.Tests/Testing/TestActions.cs +++ b/Tests/Orleankka.Tests/Testing/TestActions.cs @@ -39,16 +39,16 @@ public override void BeforeTest(ITest test) return; var sb = new SiloHostBuilder() - .Configure(options => options.ClusterId = DemoClusterId) + .Configure(options => options.ClusterId = DemoClusterId) .UseDevelopmentClustering(options => options.PrimarySiloEndpoint = new IPEndPoint(LocalhostSiloAddress, LocalhostSiloPort)) .ConfigureEndpoints(LocalhostSiloAddress, LocalhostSiloPort, LocalhostGatewayPort) .AddMemoryGrainStorageAsDefault() .AddMemoryGrainStorage("PubSubStore") .AddSimpleMessageStreamProvider("sms") + .UseInMemoryReminderService() .ConfigureServices(services => { services.Configure(options => options.CollectionAge = TimeSpan.FromMinutes(1)); - services.UseInMemoryReminderService(); }) .ConfigureApplicationParts(x => x .AddApplicationPart(GetType().Assembly) @@ -61,7 +61,7 @@ public override void BeforeTest(ITest test) host.StartAsync().Wait(); var cb = new ClientBuilder() - .ConfigureCluster(options => options.ClusterId = DemoClusterId) + .Configure(options => options.ClusterId = DemoClusterId) .UseStaticClustering(options => options.Gateways.Add(new IPEndPoint(LocalhostSiloAddress, LocalhostGatewayPort).ToGatewayUri())) .AddSimpleMessageStreamProvider("sms") .ConfigureApplicationParts(x => x