2
Shouts

Using async / await - Bnaya Eshet

published 130 days, 20 hours, 15 minutes ago posted by bnayabnaya 131 days, 9 hours, 19 minutes ago
Sunday, January 15, 2012 11:54:38 AM GMT Saturday, January 14, 2012 10:50:22 PM GMT

Using async / awaitUsing async / await this post will discuss parallel disposal.

whenever we want to dispose a parallel execution upon completion we can't use the convenient using keyword. for example, the following code may be dispose the command before completion:Very bad Code Snippetusing (var conn = newSqlConnection(CONN_STR))using (var cmd = newSqlCommand("Select * from Employee", conn)) {    conn.Open();    cmd.BeginExecuteReader(ar =>        {int affected = cmd.EndExecuteNonQuery(ar);        ...

category: Architecture | clicked: 13 | | source: blogs.microsoft.co.il | show counter code
tags: TPL, Parallel, Async, Using, Task, await

No comments yet, be the first one to post comment.

To post your comment please login or signup