Lets say I have this code:
public async void Init(){
init1();
init2();
init3();
}
First question is are they running asynchronously or not? The methods themselves are public void not async.
Second question is how do I make sure they're running async and to know when they're finished? Like this..
public async void Init(){
init1();
init2();
init3();
await ... all finished
}
Third, when I call Init() elsewhere, can it not be wrapped by an async method? Like this code below, or does it have to be async?
public async void Init(){
init1();
init2();
init3();
}
public void doIt(){
Init();
}
void Foocan't be await'ed, so really not much difference difference in usage whether it isasyncor not... Trying to reason about behavior of such method should cause pain...returndata, but not what I'm asking.WaitAll, 3. yes, NOTE: you should not be using async with voids (unless its an event handler) you should be using the TPL logic