-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalOnlyRemotingOptions.cs
More file actions
50 lines (37 loc) · 1.42 KB
/
LocalOnlyRemotingOptions.cs
File metadata and controls
50 lines (37 loc) · 1.42 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
48
49
50
using Akka.Hosting;
using System.Text;
namespace Akka.Remote.LocalOnlyIPC;
public record LocalOnlyRemotingOptions(
string ConnectionName,
int ConnectionNumber,
string SchemeIdentifier,
int MaximumPayloadBytes = 4*1024*1024)
{
internal void Build(AkkaConfigurationBuilder builder)
{
StringBuilder sb = new StringBuilder();
Build(sb);
if (sb.Length > 0)
{
builder.AddHocon(sb.ToString(), HoconAddMode.Append);
}
}
private void Build(StringBuilder sb)
{
sb.AppendLine("akka.actor.provider = remote");
sb.AppendLine("akka.remote {");
sb.AppendLine("enabled-transports = [ akka.remote.LocalOnlyIPC ]");
sb.AppendLine("LocalOnlyIPC {");
sb.AppendLine($"transport-class = " +
$"\" {typeof(LocalOnlyIPCTransport).FullName}, " +
$"{typeof(LocalOnlyIPCTransport).Assembly.GetName().Name}\"");
if (!string.IsNullOrWhiteSpace(ConnectionName))
sb.AppendLine($"connection-name = {ConnectionName}");
sb.AppendLine($"connection-number = {ConnectionNumber}");
if (!string.IsNullOrWhiteSpace(SchemeIdentifier))
sb.AppendLine($"scheme-identifier = {SchemeIdentifier}");
sb.AppendLine($"maximum-payload-bytes = {MaximumPayloadBytes}");
sb.AppendLine("}");
sb.Append("}");
}
}