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
63
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
220
The least you need to know about hashing in Swift
gregheo
0
150
Shared Mutable State
gregheo
0
480
Shared, Exclusive, Mutable, Immutable
gregheo
0
140
Getting Under Swift’s Skin
gregheo
0
530
Sanitizing Threads for Fun & Profit
gregheo
0
130
Sanitizing All* The Things
gregheo
0
60
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
400
Other Decks in Technology
See All in Technology
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
6.3k
Instant Apps Eulogy
cyrilmottier
1
110
九州の人に知ってもらいたいGISスポット / gis spot in kyushu 2025
sakaik
0
170
工業高校で学習したとあるエンジニアのキャリアの話
shirayanagiryuji
0
110
Findy Freelance 利用シーン別AI活用例
ness
0
560
AIのグローバルトレンド 2025 / ai global trend 2025
kyonmm
PRO
1
150
【OptimizationNight】数理最適化のラストワンマイルとしてのUIUX
brainpadpr
2
500
Nx × AI によるモノレポ活用 〜コードジェネレーター編〜
puku0x
0
630
Strands Agents & Bedrock AgentCoreを1分でおさらい
minorun365
PRO
8
360
AI時代の大規模データ活用とセキュリティ戦略
ken5scal
0
150
マルチプロダクト×マルチテナントを支えるモジュラモノリスを中心としたアソビューのアーキテクチャ
disc99
1
580
薬屋のひとりごとにみるトラブルシューティング
tomokusaba
0
370
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Designing for humans not robots
tammielis
253
25k
The Pragmatic Product Professional
lauravandoore
36
6.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Code Review Best Practice
trishagee
69
19k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
The Cost Of JavaScript in 2023
addyosmani
52
8.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
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
❓
%&