- 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.
推薦閱讀
- 摩登創(chuàng)客:與智能手機和平板電腦共舞
- Azure IoT Development Cookbook
- PHP基礎(chǔ)案例教程
- Django開發(fā)從入門到實踐
- DevOps入門與實踐
- 區(qū)塊鏈:以太坊DApp開發(fā)實戰(zhàn)
- 用戶體驗增長:數(shù)字化·智能化·綠色化
- Visual C#通用范例開發(fā)金典
- Node.js全程實例
- 持續(xù)集成與持續(xù)交付實戰(zhàn):用Jenkins、Travis CI和CircleCI構(gòu)建和發(fā)布大規(guī)模高質(zhì)量軟件
- Python數(shù)據(jù)可視化之美:專業(yè)圖表繪制指南(全彩)
- Python編程基礎(chǔ)教程
- Clojure Web Development Essentials
- Getting Started with Hazelcast
- jQuery EasyUI從零開始學(xué)