我在localHost Clustering模式下运行Orleans,目前有1个谷物和一个客户端.
// client code
for (int i = 0; i <num_scan; ++i)
{
Console.WriteLine("client " + i);
// the below call should have returned when first await is hit in foo()
// but it doesn't work like that
grain.foo(i);
}
// grain code
async Task foo(int i)
{
Console.WriteLine("grain "+i);
await Task.Delay(2000);
}
Run Code Online (Sandbox Code Playgroud)
输出结果如下:
client 0
client 1
client 2
client 3
client 4
client 5
client 6
grain 0
client 7
client 8
client 9
client 10
grain …Run Code Online (Sandbox Code Playgroud)