Skip to content

Commit 4fc27e6

Browse files
CopilotReubenBond
andcommitted
Update READMEs based on PR review feedback
Co-authored-by: ReubenBond <[email protected]>
1 parent 1dbb7ed commit 4fc27e6

File tree

5 files changed

+22
-28
lines changed

5 files changed

+22
-28
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
33
"rollForward": "major",
4-
"version": "8.0.115"
4+
"version": "8.0.408"
55
}
66
}

src/AdoNet/Orleans.Clustering.AdoNet/README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ using Microsoft.Extensions.Hosting;
2525
using Orleans.Configuration;
2626
using Orleans.Hosting;
2727

28-
var builder = new HostBuilder()
28+
var builder = Host.CreateApplicationBuilder(args)
2929
.UseOrleans(siloBuilder =>
3030
{
3131
siloBuilder
@@ -34,11 +34,6 @@ var builder = new HostBuilder()
3434
{
3535
options.Invariant = "System.Data.SqlClient"; // Or other providers like "MySql.Data.MySqlClient", "Npgsql", etc.
3636
options.ConnectionString = "Server=localhost;Database=OrleansCluster;User Id=myUsername;******;";
37-
})
38-
.Configure<ClusterOptions>(options =>
39-
{
40-
options.ClusterId = "my-cluster";
41-
options.ServiceId = "MyOrleansService";
4237
});
4338
});
4439

@@ -53,7 +48,7 @@ using Microsoft.Extensions.Hosting;
5348
using Orleans;
5449
using Orleans.Configuration;
5550

56-
var clientBuilder = new HostBuilder()
51+
var clientBuilder = Host.CreateApplicationBuilder(args)
5752
.UseOrleansClient(clientBuilder =>
5853
{
5954
clientBuilder
@@ -62,16 +57,18 @@ var clientBuilder = new HostBuilder()
6257
{
6358
options.Invariant = "System.Data.SqlClient"; // Or other providers like "MySql.Data.MySqlClient", "Npgsql", etc.
6459
options.ConnectionString = "Server=localhost;Database=OrleansCluster;User Id=myUsername;******;";
65-
})
66-
.Configure<ClusterOptions>(options =>
67-
{
68-
options.ClusterId = "my-cluster";
69-
options.ServiceId = "MyOrleansService";
7060
});
7161
});
7262

7363
var host = await clientBuilder.StartAsync();
7464
var client = host.Services.GetRequiredService<IClusterClient>();
65+
66+
// Get a reference to a grain and call it
67+
var grain = client.GetGrain<IHelloGrain>("user123");
68+
var response = await grain.SayHello("World");
69+
70+
// Keep the host running until the application is shut down
71+
await host.WaitForShutdownAsync();
7572
```
7673

7774
## Database Setup
@@ -85,7 +82,7 @@ Before using the ADO.NET clustering provider, you need to set up the necessary d
8582

8683
## Documentation
8784
For more comprehensive documentation, please refer to:
88-
- [Microsoft Orleans Documentation](https://docs.microsoft.com/dotnet/orleans/)
85+
- [Microsoft Orleans Documentation](https://learn.microsoft.com/dotnet/orleans/)
8986
- [Clustering providers](https://learn.microsoft.com/en-us/dotnet/orleans/implementation/cluster-management)
9087
- [Relational Database Provider](https://learn.microsoft.com/en-us/dotnet/orleans/implementation/relational-storage-providers)
9188

src/Orleans.Runtime/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ await host.StartAsync();
3838

3939
## Documentation
4040
For more comprehensive documentation, please refer to:
41-
- [Microsoft Orleans Documentation](https://docs.microsoft.com/dotnet/orleans/)
41+
- [Microsoft Orleans Documentation](https://learn.microsoft.com/dotnet/orleans/)
4242
- [Server configuration](https://learn.microsoft.com/en-us/dotnet/orleans/host/configuration-guide/server-configuration)
4343
- [Silo lifecycle](https://learn.microsoft.com/en-us/dotnet/orleans/implementation/silo-lifecycle)
4444
- [Clustering](https://learn.microsoft.com/en-us/dotnet/orleans/implementation/cluster-management)

src/Orleans.Sdk/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,29 @@ using Orleans.Configuration;
3737
using Orleans.Hosting;
3838

3939
// Create the host
40-
var builder = new HostBuilder()
40+
var builder = Host.CreateApplicationBuilder(args)
4141
.UseOrleans(siloBuilder =>
4242
{
4343
siloBuilder
4444
.UseLocalhostClustering()
45-
.Configure<ClusterOptions>(options =>
46-
{
47-
options.ClusterId = "dev-cluster";
48-
options.ServiceId = "MyOrleansApp";
49-
})
5045
.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(HelloGrain).Assembly).WithCodeGeneration());
5146
});
5247

5348
// Start the host
5449
var host = builder.Build();
5550
await host.StartAsync();
51+
// Keep the host running until the application is shut down
52+
await host.WaitForShutdownAsync();
53+
54+
// Get a reference to a grain and call it
55+
var client = host.Services.GetRequiredService<IClusterClient>();
56+
var grain = client.GetGrain<IHelloGrain>("user123");
57+
var response = await grain.SayHello("World");
5658
```
5759

5860
## Documentation
5961
For more comprehensive documentation, please refer to:
60-
- [Microsoft Orleans Documentation](https://docs.microsoft.com/dotnet/orleans/)
62+
- [Microsoft Orleans Documentation](https://learn.microsoft.com/dotnet/orleans/)
6163
- [Getting started with Orleans](https://learn.microsoft.com/en-us/dotnet/orleans/tutorials-and-samples/tutorial-1)
6264
- [Grains](https://learn.microsoft.com/en-us/dotnet/orleans/grains/)
6365
- [Hosting Orleans](https://learn.microsoft.com/en-us/dotnet/orleans/host/)

src/Orleans.Server/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ var builder = new HostBuilder()
2323
{
2424
siloBuilder
2525
.UseLocalhostClustering()
26-
.Configure<ClusterOptions>(options =>
27-
{
28-
options.ClusterId = "dev-cluster";
29-
options.ServiceId = "MyOrleansApp";
30-
})
3126
.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(MyGrain).Assembly).WithCodeGeneration());
3227
});
3328

@@ -41,7 +36,7 @@ await host.WaitForShutdownAsync();
4136

4237
## Documentation
4338
For more comprehensive documentation, please refer to:
44-
- [Microsoft Orleans Documentation](https://docs.microsoft.com/dotnet/orleans/)
39+
- [Microsoft Orleans Documentation](https://learn.microsoft.com/dotnet/orleans/)
4540
- [Orleans server (silo) configuration](https://learn.microsoft.com/en-us/dotnet/orleans/host/configuration-guide/server-configuration)
4641
- [Hosting Orleans](https://learn.microsoft.com/en-us/dotnet/orleans/host/generic-host)
4742
- [Grain persistence](https://learn.microsoft.com/en-us/dotnet/orleans/grains/grain-persistence)

0 commit comments

Comments
 (0)