- 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.
推薦閱讀
- 演進式架構(原書第2版)
- R語言經典實例(原書第2版)
- 自制編譯器
- Learning Laravel 4 Application Development
- 機械工程師Python編程:入門、實戰與進階
- Swift細致入門與最佳實踐
- HTML5+CSS3 Web前端開發技術(第2版)
- Spring 5 Design Patterns
- Application Development with Parse using iOS SDK
- Mastering OAuth 2.0
- jQuery從入門到精通(微課精編版)
- SCRATCH編程課:我的游戲我做主
- Hands-On ROS for Robotics Programming
- SQL Server 2014數據庫設計與開發教程(微課版)
- C語言從入門到精通(第5版)