vendredi 22 avril 2016

Sequential await VS Continuation await

I was wondering what is the best/correct way of writing asynchronous code that is composed of two (or more) async and dependent (the first have to finish to execute second) operations.

Example with async/await:

await RunFirstOperationAsync();
await RunSecondOperationAsync();

Example with Continuation:

await RunFirstOperationAsync()
    .ContinueWith(t => RunSecondOperationAsync());

Aucun commentaire:

Enregistrer un commentaire