-
-
Notifications
You must be signed in to change notification settings - Fork 295
Expand file tree
/
Copy pathProgram.cs
More file actions
22 lines (19 loc) · 606 Bytes
/
Program.cs
File metadata and controls
22 lines (19 loc) · 606 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;
using System.Threading.Tasks;
using Common;
using Proto;
using Proto.Remote;
using Proto.Remote.GrpcNet;
using static Proto.Remote.RemoteConfig;
using static System.Threading.Channels.Channel;
var system = new ActorSystem().WithRemote(BindToLocalhost(8000));
await system.Remote().StartAsync();
var channel = CreateUnbounded<MyMessage>();
_ = ChannelPublisher.StartNew(system.Root, channel, "publisher");
//produce messages
for (var i = 0; i < 30; i++)
{
Console.WriteLine("Sending message " + i);
await channel.Writer.WriteAsync(new MyMessage(i));
await Task.Delay(1000);
}