-
-
Notifications
You must be signed in to change notification settings - Fork 295
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (29 loc) · 967 Bytes
/
Program.cs
File metadata and controls
36 lines (29 loc) · 967 Bytes
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
// -----------------------------------------------------------------------
// <copyright file="Program.cs" company="Asynkron AB">
// Copyright (C) 2015-2024 Asynkron AB All rights reserved
// </copyright>
// -----------------------------------------------------------------------
using System;
using System.Threading.Tasks;
using Proto;
namespace Futures;
internal class Program
{
private static async Task Main(string[] args)
{
var context = new RootContext(new ActorSystem());
var props = Props.FromFunc(ctx =>
{
if (ctx.Message is string)
{
ctx.Respond("hey");
}
return Task.CompletedTask;
}
);
var pid = context.Spawn(props);
var reply = await context.RequestAsync<string>(pid, "hello");
Console.WriteLine(reply);
Console.ReadLine();
}
}