|
8 | 8 | <para> |
9 | 9 | The openstack.net SDK is migrating to an asynchronous service model using the <token>TaskBasedAsync</token> |
10 | 10 | for ongoing feature support. This page contains information about several aspects of the asynchronous interfaces |
11 | | - which could result in some confusion during development. It also describes the inclusion of extension methods |
12 | | - that allow new product features to be used in code that is not allowed to make asynchronous API |
13 | | - calls. |
| 11 | + which could result in some confusion during development. |
14 | 12 | </para> |
| 13 | + <para> |
| 14 | + Users unfamiliar with asynchronous programming may find the following introduction particularly valuable. |
| 15 | + </para> |
| 16 | + <list class="bullet"> |
| 17 | + <listItem> |
| 18 | + <para> |
| 19 | + <externalLink> |
| 20 | + <linkText>Async and Await</linkText> |
| 21 | + <linkUri>http://blog.stephencleary.com/2012/02/async-and-await.html</linkUri> |
| 22 | + </externalLink> |
| 23 | + </para> |
| 24 | + </listItem> |
| 25 | + </list> |
15 | 26 | </introduction> |
16 | 27 |
|
17 | 28 | <section address="LanguageSupport"> |
|
194 | 205 | execution of the task itself. The documentation for asynchronous methods does not distinguish between these |
195 | 206 | two cases, allowing for any of the specified exceptions to be thrown in either manner. |
196 | 207 | </para> |
| 208 | + <alert class="important"> |
| 209 | + <para> |
| 210 | + This documentation uses the term asynchronous method to refer to any method with a return type of |
| 211 | + <codeEntityReference>T:System.Threading.Tasks.Task</codeEntityReference> or |
| 212 | + <codeEntityReference>T:System.Threading.Tasks.Task`1</codeEntityReference>. Languages with built-in support |
| 213 | + for asynchronous programming have their own related terminology which may differ in meaning. |
| 214 | + </para> |
| 215 | + </alert> |
197 | 216 | </content> |
198 | 217 |
|
199 | 218 | <sections> |
|
231 | 250 | <para> |
232 | 251 | This library additionally ensures that exceptions thrown by asynchronous operations are not wrapped in |
233 | 252 | multiple layers of <codeEntityReference>T:System.AggregateException</codeEntityReference>. In other words, |
234 | | - an <codeEntityReference>T:System.AggregateException</codeEntityReference> thrown during the asynchronous |
| 253 | + an <codeEntityReference>T:System.ArgumentException</codeEntityReference> thrown during the asynchronous |
235 | 254 | execution of a task will result in the |
236 | 255 | <codeEntityReference>P:System.Threading.Tasks.Task.Exception</codeEntityReference> property returning an |
237 | | - <codeEntityReference>T:System.AggregateException</codeEntityReference> with exactly one inner exception, |
238 | | - which is the original <codeEntityReference>T:System.ArgumentException</codeEntityReference>. This |
239 | | - guarantee simplifies the use of the API is languages that support <token>AsyncAwait</token>, since those |
240 | | - operators automatically unwrap the first layer of |
241 | | - <codeEntityReference>T:System.AggregateException</codeEntityReference>. |
| 256 | + <codeEntityReference>T:System.AggregateException</codeEntityReference>, and that exception will not |
| 257 | + contain an nested instances of <codeEntityReference>T:System.AggregateException</codeEntityReference> in |
| 258 | + the <codeEntityReference>P:System.AggregateException.InnerExceptions</codeEntityReference> collection. In |
| 259 | + most cases, the <codeEntityReference>T:System.AggregateException</codeEntityReference> wraps exactly one |
| 260 | + inner exception, which is the original |
| 261 | + <codeEntityReference>T:System.ArgumentException</codeEntityReference>. This guarantee simplifies the use |
| 262 | + of the API is languages that support <token>AsyncAwait</token>, since those operators automatically unwrap |
| 263 | + the first layer of <codeEntityReference>T:System.AggregateException</codeEntityReference>. |
242 | 264 | </para> |
243 | 265 | <code language="cs" region="ExceptionDuringTaskExecution" source="..\Samples\CSharpCodeSamples\AsynchronousExceptionsExamples.cs"/> |
244 | 266 | <code language="vb" region="ExceptionDuringTaskExecution" source="..\Samples\VBCodeSamples\AsynchronousExceptionsExamples.vb"/> |
|
0 commit comments