I think async/await keywords here are redundant.
Parallel.Invoke(
async () => await DoSomethingAsync(1).ConfigureAwait(false),
async () => await DoSomethingAsync(2).ConfigureAwait(false)
);
Given a number of task-returning methods, is there any more straightforward way to run them in parallel and return when all are complete?
await Task.WhenAll(DoSomethingAsync(1), DoSomethingAsync(2));
Optionally add .ConfigureAwait(false)
to the WhenAll()
, depending on context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With