-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
47 lines (37 loc) · 1.41 KB
/
Program.cs
File metadata and controls
47 lines (37 loc) · 1.41 KB
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
using System.Collections.Concurrent;
using Couchbase.Analytics.Performer.Internal.Connections;
using Couchbase.Analytics.Performer.Internal.Logging;
using Couchbase.Analytics.Performer.Internal.Services;
using Couchbase.Grpc.Protocol.Columnar;
using Grpc.Core;
using Serilog;
namespace Couchbase.Analytics.Performer;
public class Program
{
private static ConcurrentDictionary<string, ClusterConnection> _clusters = new();
public static async Task Main(string[] args)
{
var loggerFactory = LoggingUtils.ConfigureLogging(out var minimumLevel);
var (host, port) = ("localhost", 8060);
var server = new Server
{
Ports =
{
new ServerPort(host, port, ServerCredentials.Insecure)
},
Services =
{
ColumnarService.BindService(new AnalyticsPerformerService(_clusters)),
ColumnarCrossService.BindService(new AnalyticsPerformerCrossService(_clusters))
}
};
server.Start();
Log.Information(".NET Analytics Performer started on {Host}:{Port} at LogLevel {Level}", host, port, minimumLevel);
Log.Information("Press any key to stop the server");
Console.ReadKey();
await server.ShutdownAsync().ConfigureAwait(false);
LoggingUtils.ShutdownLogging();
Log.Information("Press any key to exit");
Console.ReadKey();
}
}