“An async method can also have a void return type. This return type is used primarily to define event handlers, where a void return type is required. Async event handlers often serve as the starting point for async programs.
An async method that has a void return type can't be awaited, and the caller of a void-returning method can't catch any exceptions that the method throws.”
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/task-asynchronous-programming-model
An async method that has a void return type can't be awaited, and the caller of a void-returning method can't catch any exceptions that the method throws.”
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/task-asynchronous-programming-model
Docs
The Task Asynchronous Programming (TAP) model with async and await" - C#
Learn when and how to use Task-based async programming, a simplified approach to asynchronous programming in C#.
雷姬家的阁楼书架
“An async method can also have a void return type. This return type is used primarily to define event handlers, where a void return type is required. Async event handlers often serve as the starting point for async programs. An async method that has a void…
public async void GetSomethingAsync()
{
//do worked, and caller will be block.
var result = await DoWorkAsync();
// DoWorkAsync() funciton return a Task<value> or other thing that async funciton is allowed
// except void
// and the control will return to the caller of GetSomethingAsync()
ResultHandler(result.value);
// when DoWorkAsync() finish the work, the control will come back to the point that await is used
// and then the other work that need the real result of DoWorkAsync() can go on
return;
}
雷姬家的阁楼书架
https://t.me/tnews365/17920 逐一发送坦克
Telegram
竹新社
苏丹过渡主权委员会主席阿卜杜勒·法塔赫·阿勒·布尔汉(Abdel Fattah Al-Burhan)25日宣布,全国进入紧急状态,同时解散政府和过渡主权委员会。
布尔汉声称,军方将继续推行民主过渡,直到将权力移交给民选文职政府。
他说:“为了纠正革命的路线,我宣布全国进入紧急状态,解散政府和过渡主权委员会。从2019年开始生效的宪法宣言一些条款不再有效力”。
他指出,苏丹国内发生的事件对国家构成威胁。
首都喀土穆市内多个市区互联网被切断,军方封锁了市内的桥梁。抗议者封锁了首都的数条街道,并焚烧轮胎。另据…
布尔汉声称,军方将继续推行民主过渡,直到将权力移交给民选文职政府。
他说:“为了纠正革命的路线,我宣布全国进入紧急状态,解散政府和过渡主权委员会。从2019年开始生效的宪法宣言一些条款不再有效力”。
他指出,苏丹国内发生的事件对国家构成威胁。
首都喀土穆市内多个市区互联网被切断,军方封锁了市内的桥梁。抗议者封锁了首都的数条街道,并焚烧轮胎。另据…