小编She*_* Ni的帖子

普通C#和奥尔良方法调用之间的区别

我在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)

c# asp.net async-await orleans

2
推荐指数
1
解决办法
369
查看次数

标签 统计

asp.net ×1

async-await ×1

c# ×1

orleans ×1