- Learning Concurrency in Kotlin
- Miguel Angel Castiblanco Torres
- 129字
- 2021-08-05 10:46:51
Job and Deferred
We can divide our asynchronous functions into two groups:
- Those without a result. Common scenarios are background tasks that write to a log, send analytics, and similar tasks. This type can include background tasks that may be monitored for completion but that don't have a result.
- Those that return a result. For example, if an asynchronous function is fetching information from a web service, you will most likely want to have that function return that information in order to use it.
In both cases, you will still want to have access to the task and react if there is an exception or cancel them if their work is not required anymore. Let's take a look at how we can create and interact with both types.
推薦閱讀
- Java高并發核心編程(卷2):多線程、鎖、JMM、JUC、高并發設計模式
- 實用防銹油配方與制備200例
- Mastering Python Networking
- Modular Programming in Java 9
- Learning OpenStack Networking(Neutron)(Second Edition)
- Spring+Spring MVC+MyBatis從零開始學
- Serverless Web Applications with React and Firebase
- Application Development with Parse using iOS SDK
- Learning Unreal Engine Game Development
- 產品架構評估原理與方法
- Java Web程序開發參考手冊
- Ionic Framework By Example
- TensorFlow 2.0深度學習應用實踐
- UI設計參考手冊
- Unreal Engine 4 Scripting with C++ Cookbook