-
-
Notifications
You must be signed in to change notification settings - Fork 157
/
Program.cs
49 lines (45 loc) · 1.67 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Orleans;
using Orleans.Configuration;
using Orleans.Hosting;
using System.Net;
using TestGrains;
namespace TestHost
{
public static class Program
{
private static readonly int GatewayPort = 30000;
private static readonly int SiloPort = 11111;
private static readonly IPAddress SiloAddress = IPAddress.Loopback;
public static void Main(string[] args)
{
//
// In this sample we let the dashboard host kestrel and the backend services.
//
Host.CreateDefaultBuilder(args)
.UseOrleans((_, builder) =>
{
builder.UseDevelopmentClustering(options => options.PrimarySiloEndpoint = new IPEndPoint(SiloAddress, SiloPort));
builder.UseInMemoryReminderService();
builder.AddMemoryGrainStorageAsDefault();
builder.ConfigureEndpoints(SiloAddress, SiloPort, GatewayPort);
builder.Configure<ClusterOptions>(options =>
{
options.ClusterId = "helloworldcluster";
options.ServiceId = "1";
});
builder.UseDashboard(options =>
{
options.HostSelf = true;
});
})
.ConfigureServices(services =>
{
services.AddSingleton<IHostedService, TestGrainsHostedService>();
})
.Build()
.Run();
}
}
}