Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
Now that we have the synchronous version, we can attempt to model the asynchronous version similarly. A function which launches an asynchronous operation is called an ['initiating function]. While the synchronous version above produces an error code through an output parameter, the asynchronous version delivers the error code to a completion handler or other custom mechanism defined by the completion token. The signature of the initiating function reflects these differences.有了同步版本之后,可以尝试以类似方式构建异步版本。启动异步操作的函数称为发起函数。上述同步版本通过输出参数返回错误码,而异步版本则通过完成处理器或由完成令牌定义的其他自定义机制来传递错误码。发起函数的签名反映了这些差异。