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
160
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
150
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
善意の活動は、なぜ続かなくなるのか ーふりかえりが"構造を変える判断"になった半年間ー
matsukurou
0
540
業務の煩悩を祓うAI活用術108選 / AI 108 Usages
smartbank
9
22k
スクラムマスターが スクラムチームに入って取り組む5つのこと - スクラムガイドには書いてないけど入った当初から取り組んでおきたい大切なこと -
scrummasudar
3
2.1k
Proxmoxで作る自宅クラウド入門
koinunopochi
0
110
Scrum Guide Expansion Pack が示す現代プロダクト開発への補完的視点
sonjin
0
690
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
330
Vivre en Bitcoin : le tutoriel que votre banquier ne veut pas que vous voyiez
rlifchitz
0
210
たかがボタン、されどボタン ~button要素から深ぼるボタンUIの定義について~ / BuriKaigi 2026
yamanoku
1
270
Models vs Bounded Contexts for Domain Modularizati...
ewolff
0
200
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
3
380
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
1
920
AI との良い付き合い方を僕らは誰も知らない (WSS 2026 静岡版)
asei
1
320
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Building Adaptive Systems
keathley
44
2.9k
Leo the Paperboy
mayatellez
3
1.3k
Everyday Curiosity
cassininazir
0
120
From π to Pie charts
rasagy
0
110
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
44
How GitHub (no longer) Works
holman
316
140k
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
Getting science done with accelerated Python computing platforms
jacobtomlinson
1
98
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
❓
%&