-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathTestActorController.cs
More file actions
54 lines (42 loc) · 1.06 KB
/
TestActorController.cs
File metadata and controls
54 lines (42 loc) · 1.06 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
51
52
53
54
using Microsoft.Extensions.Logging;
using Netx;
using Netx.Actor;
using Netx.Loggine;
using System.Threading.Tasks;
namespace ActorTest
{
[ActorOption(maxQueueCount: 1000, ideltime: 3000)]
public class TestActorController : ActorController
{
public ILog Log { get; }
public TestActorController(ILogger<TestActorController> logger)
{
Log = new DefaultLog(logger);
}
public long xa { get; private set; }
[TAG(2000)]
public Task<int> Add(int a, int b)
{
xa++;
return Task.FromResult(a + b);
}
[TAG(2001)]
public Task<long> GetV()
{
return Task.FromResult(xa);
}
[TAG(2010)]
public async Task<int> Add2(int a, int b)
{
var x = await Get<ICallServer>().AddX();
xa = a + b - x;
return a + b;
}
[TAG(20000)]
public async Task<int> TestWait(int a)
{
await Task.Delay(100);
return a;
}
}
}