You don't really need to do anything manually, await
keyword pauses the function execution until blah()
returns.
private async void SomeFunction()
{
var x = await LoadBlahBlah(); <- Function is not paused
//rest of the code get's executed even if LoadBlahBlah() is still executing
}
private async Task<T> LoadBlahBlah()
{
await DoStuff(); <- function is paused
await DoMoreStuff();
}
T
is type of object blah()
returns
You can't really await
a void
function so LoadBlahBlah()
cannot be void