Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Promises, Futures, and the Shape of Your Code
Search
Greg Heo
May 21, 2018
Technology
0
68
Promises, Futures, and the Shape of Your Code
Greg Heo
May 21, 2018
Tweet
Share
More Decks by Greg Heo
See All by Greg Heo
Concurrency From the Ground Up
gregheo
0
230
The least you need to know about hashing in Swift
gregheo
0
170
Shared Mutable State
gregheo
0
520
Shared, Exclusive, Mutable, Immutable
gregheo
0
150
Getting Under Swift’s Skin
gregheo
0
550
Sanitizing Threads for Fun & Profit
gregheo
0
160
Sanitizing All* The Things
gregheo
0
63
Thirteen Ways of Looking at a View Controller
gregheo
0
130
Five Unbelievable Secrets of Reactive Programming the Experts Don't Want You to Know!
gregheo
3
410
Other Decks in Technology
See All in Technology
2026年、サーバーレスの現在地 -「制約と戦う技術」から「当たり前の実行基盤」へ- /serverless2026
slsops
2
260
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
490
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.2k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
20260204_Midosuji_Tech
takuyay0ne
1
160
Codex 5.3 と Opus 4.6 にコーポレートサイトを作らせてみた / Codex 5.3 vs Opus 4.6
ama_ch
0
200
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.6k
AI駆動開発を事業のコアに置く
tasukuonizawa
1
360
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
500
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
2
330
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
390
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
130
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
220
Evolving SEO for Evolving Search Engines
ryanjones
0
130
BBQ
matthewcrist
89
10k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
110
What's in a price? How to price your products and services
michaelherold
247
13k
Believing is Seeing
oripsolob
1
58
Raft: Consensus for Rubyists
vanstee
141
7.3k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
170
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
170
Test your architecture with Archunit
thirion
1
2.2k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
310
Transcript
@gregheo C1 Mobile Summit
++++++++[>++++[>++>+ ++>+++>+<<<<-]>+>+>- >>+[<]<-]>>.>---.+++ ++++..+++.>>.<-.<.++ +.------.--------.>> +.>++.
None
None
None
None
None
!
networker.beginRequest(.read, success: { data in })
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in }
})
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in } } })
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in } } } })
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in print("Save success!") } } } }) print("Hello 1") print("Hello 2")
⏰#
None
A B C X Y Z
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in print("Save success!") } } } }) print("Hello 1") print("Hello 2")
⏰#
networker.beginRequest(.read, success: { data in parser.parseRaw(data) { result in archiver.materialize(from:
result) { objects in dataStore.save(objects) { status in print("Save success!") } } } })
Clojure
Future
(defn square [x] (* x x) )
(defn square [x] (future (* x x)) )
(defn saveToDisk [data] (future ( ... )) )
saveToDisk future completed? cancelled? value
@myFuture (deref myFuture)
A X Y future B C D (deref future)
Future
Promise
@myPromise (deref myPromise)
getValue promise realized? value promise deliver
Promise
❓
%&